Eclipse Create Javaweb Project

Source: Internet
Author: User
Tags tomcat server

There is no tomcat in the new eclipse just downloaded, the first thing to run the Javaweb project must be the Tomcat server. Enter Eclipse, first set up some basic settings, and then configure Tomcat, basic configuration, such as modify Eclipse font size, Eclipse's default character encoding, unified with UTF-8 bar, this is not prone to garbled problem.

1. Set the Eclipse font first

Click on the preperences below the window to enter the following interface, click on the appearance below the general colors and Fonts

Then click Basic in the middle, slide to the bottom text Font, then click Edit

It's better to choose this type of font (or look at personal habits, of course).

2. Set the encoding to UTF-8

Need to set up a few parts, first general under the work space below the code, direct point workspace, do not point below, this setting and then set the JSP file and HTML file

Set the default encoding for files such as html,jsp

Select these directories and open them in turn to see if they are UTF-8

3. Configure Tomcat

Press window first, then press preference to enter the interface you just configured the font, and then select the server button below

Click Runtime enviroment

When Tomcat is not configured, this column is blank, without the Tomcat environment, click the Add button on the right

Download is a few versions of Tomcat, choose a few versions click in, select the button below

Select the path of the downloaded Tomcat

My tomcat is the following path and then selected.

Modify this place again, select the JDK you configured at that time, then click Finish.

4. Create the project: These settings are OK, go to the theme and create the Javaweb project.

Click on this File button, then press new, and then let's select the type of project created, Javaweb project is called Dynamic Web project, if you do not find this on the right, select other and enter the following interface

Enter DY in this input box to enter the following interface

Select this item, and then

Only need to change these two places, take the project name, and select 2.5 (2.5 is because 2.5 is more stable, than 3.1 stable), the others do not move, directly press finish, this time to create a good project.

5. Create a JSP file, in the WebContent path, as long as the point to webcontent on the line, do not point to the following Meta-inf or Web-inf.

right mouse button, new JSP file. Similarly, if the JSP file is not found, then click on other, go to search

Click Next to enter the name of the file. Generally write index.jsp. Because index.jsp will be started by default when the Web project is run.

Is the file that is configured under Web-inf to the default startup of Web. XML (This is not for the time being, it will be understood later)

Click Finish to complete the creation.

And then in the inside some content.

There is also a Web. XML, which is the configuration of the default startup resources

Click index.jsp to start editing the file as follows.

After editing, find the name of the project, such as my project name is B, the mouse on the B, the right mouse button, select Run as, and then press run on Sever, enter the following page

Click Finish to run, wait for the server to start

Eclipse Create Javaweb Project

Related Article

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.