Java Web Learning (5): Developing Web Applications using the IDE (ECLIPSE)

Source: Internet
Author: User
Tags java web tomcat server apache tomcat

A configuration of Eclipse (1) Eclipse configuration JRE

Find window->prefereneces->java->installed JREs on the page that opens


In the Open Prefereneces dialog we see that the system is using its own JDK version by default, and we recommend using the JDK 8.0 that you installed.

Click the Add option, the Add JRE dialog box appears, and we select the standard VM.


Then proceed to the next step and find the installation directory where you installed JDK 8.0 and click Finish.



(2) Eclipse integrated Tomcat server

Find Window->prefereneces->server->runtime Environments


Open the prefereneces dialog box, click the Add option, in the dialog box that appears we select Apache Tomcat v8.0, click Continue,


we chose to follow the Tomcat 8.0 installation directory, as well as our own installed JDK 8, 0, click Finish can be made.



two using Eclipse to write the first Web application (1) Building UTF-8 development environment

Before the development of the project, it is important to specify the character encoding format used, it is recommended to use UTF-8 encoding to create the project, then we create the JSP page

Face, the default is UTF-8 code how to do it?

We found window->prefereneces->web->jsp Files, in which the character encoding format changes, and finally click on the application.


(2) Create the first Web application

Right-click New in the left margin, select Project, the New Project dialog box appears, select Dynamic Web project, click Next

Step.


In the dialog box that appears, write the new project name, select the appropriate published Tomcat server and version number, and click Done.


The Web project directory structure appears on the left, and the contents and directories need to be memorized.


We create a new JSP file under WebContent, as shown in the content.


After the code is edited, we publish the project, right-click in the editor to select Run on Server under Run As, select the dialog box that appears

To publish the Tomcat server, click Done.


When the previous step is complete, Eclipse automatically launches the Tomcat server and opens a built-in browser to display our Web application. So far

We have completed the simple development of Web applications.

Three Modify the Tomcat server default port

More or less we all have a problem with the port number being occupied, we can modify the Tomcat server's default port number.

We open the Server.xml configuration file under the Conf directory of the Tomcat 8.0 installation directory.


Modify the Server.xml configuration file, and find the code like the following to modify the default port 8080 to the port number you want to set. General use

The larger port number after 1024 in case the port number set is occupied by another application.




Java Web Learning (5): Developing Web Applications using the IDE (ECLIPSE)

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.