1. Import the sample Web project
(1) Download the sample Web project.
(2) Select File>import.
(3) Expand General, then select an existing project in the workspace and click Next.
Import an existing project
(4) Choose the Select Archive File option, browse the downloaded zip files, and click Finish.
Select an archive file to import
(5) Migrate the project according to the wizard.
2. Deploying Web Projects
Now that you have a Web project that needs to work, you can deploy it to Tomcat and start developing its real-time nature.
(1) Right-click the MyEclipse tomcat server in the server view and select Add/remove deployment.
(2) Select Simplewebproject in the Available columns and click Add. The archive that is expanded by default deployment mode lets you see the changes immediately without having to redeploy the application. Click Done.
Add Project to Server
(3) Verify that the deployment was successful by expanding the MyEclipse Tomcat server.
Successfully deployed3. Run the Web project
The first thing to run a project is to start the MyEclipse Tomcat server. When the server is running, you can run or debug the application that is deployed on it.
(1) In the server view, select the MyEclipse Tomcat server, and then click the Debug Server icon. MyEclipse switches to the console view so that you can see the server's messages, including the confirmation of the startup.
Tomcat startup confirms the switch back to the server's view and displays the debug server status.
Server Run Status
(2) Right-click the item in the server view and choose Open Web Browser. Load on the JSP page.
Run the JSP page in the browser
(3) Expand the Web project's root folder, and then double-click index.jsp to open the editor.
(4) Select and delete "This is my JSP page" and press CTRL + S to save.
Modify JSP
(5) Click the Web browser option, and you can see your changes immediately.
Refresh the browser display changes4. Debugging Web Projects
Debugging an application does not just stop at breakpoints and check values, you can also change the value of a variable immediately during a debugging session, because you can see in your application whether it will be implemented immediately.
The JSP page for the project contains a scriptlet that you can change the value of "Secretcode" in the debugger.
(1) Switch back to index.jsp option, click the design option at the bottom of the editor.
You can see that the design and source views are synchronous, while also paying attention to the declaration of the H4X0R value of the Secretcode variable.
(2) Double-click the breakpoint set at the edge of the 33 line (the scriplet of the row will output the variable value).
JSP page with Scriplet
(3) Return to the Web browser and refresh the page to trigger the breakpoint.
Trigger a breakpoint
Quite a lot of information shows that the Tomcat thread has been paused while the breakpoint has been triggered and the application stops at the bottom of the screen. At the top right of the screen, you can see the assignment of variables and thesecretcode variables defined in the JSP page.
(4) Select the value and adjust its value.
Select variable to change the value
(5) Click Continue to load the page.
(6) switch back to the Web browser and display the Secretcode new value.
Output updated values on a Web page
MyEclipse official Chinese online line, welcome to download Communication!
MyEclipse deployment project of application server to Tomcat server