After creating a web project in eclipse, you can directly run and debug your web application in eclipse. What's even more exciting is that eclipse supports creating your web pages by dragging controls like dreamwaver, which avoids the pain of constantly switching between tools during development (JavaCodeUsing eclipse, while JSP pages using dreamwaver), greatly improving web development efficiency. The steps for creating a web project are as follows:
1. In the Add project dialog box, select Dynamic Web project ]:
2. Click Next and enter your project name in project name. If you need to use JSF in your application, in deployments, you can select the assumerver faces V1.1 project ]:
3. After [next], select [dynamic web module] and [Java]. If your project needs to use JSF, you can select the [events] and [events server faces V1.1 project] in [events ]:
4. After [next], set the Web Service root path, Web Resource Directory Name, and,Source codeDirectory:
5. Click Finish. After the project is created, the directory created by eclipse is displayed in project explorer:
6. After creating a web project, you also need to create a server to run and debug your application in eclipse. Click file-> New-> other.... In the displayed dialog box, select Server ]:
7. After [next], select your Web container in the pop-up dialog box. Here I select tomcat5.5:
8. Then [next]. In the pop-up dialog box, select the installation directory and JRE version of your Tomcat:
9. After [next], in the [new server] dialog box, the list box on the left lists all web projects in the workspace, And the list box on the right shows the WEB Project deployed on this server, here we add dynweb:
10. Click Finish and the server is created:
11. After creating the server, you can click Start the server and start the server in debug mode on the servers panel to run and debug your application:
When you debug and run your application, eclipse will synchronize your project. Metadata \. plugins \ org. Eclipse. WST. server. Core \ tmp0 \ webapps \. all the resources you access will be in this directory:
After creating a web project, you can design your page like in dreamwaver. Eclipse provides support for controls in HTML, JSF, and struts, in the inter-group panel, you can select the control you need to add to your page, and you can also see the added effect:
In addition, you can edit and design your page in different views:
When you need to debug your applicationProgramYou can first enter the debug mode, and then mark the breakpoint where you need to debug:
When you trigger the code running where the breakpoint is located on the page, you can switch to eclipse for debugging: