Developing a dynamic WEB project application with Eclipse

Source: Internet
Author: User

First, create the server
Select File > New > Other>server from the menu to create the Server, as shown in.

Ii. creating dynamic Web Project Projects

1. menu Select File > New >other>web> Dynamic Web project, new project, project name Helloweb, other values default.

2. Set the Java Build Path of the project Helloweb

Mouse Right-click Project Helloweb>build path>configue build Path...>java build Path>libraries>add External JARs

Select the Servlet-api.jar in Apache-tomcat-8.0.9\lib

Iii. creating and running JSP files
1, right-click the project, New >other>web>jsp File, enter index.jsp, other values default.
2. Insert the following code in the <body></body> Center:
<% java.util.Date D =new java.util.Date ();%>
3. index.jsp file Right-click Run As>run on server to view the results of the run.

Iv. Creating and running a servlet file
1. Right-click the project, New >other>web>servlet,java package: Com.demo,class Name: Helloworldservlet
2. Add the following code to the Doget method:
Response.getwriter (). Write ("Hello, world!");
3. Run the servlet and look at the results after restarting the server

Developing a dynamic WEB project application with Eclipse

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.