Configure the debug mode of eclipse
I. Summary:
Eclipse is used here 3.0.1 For the corresponding myeclipse, the web server uses Tomcat 5.5.05 (to set breakpoints in JSP for debugging, Tomcat 5 is required. of course, j2sdk is also required. Here we use j2sdk 1.5.0 _ 05. It doesn't matter if it is JDK 1.5.0 or above.
Ii. Software Installation and Registration
Myeclipse is an EXE installation file. If you have an installation wizard, double-click the installation file and select the eclipse installation directory (such as D:/eclipse) and its own installation directory (such as D:/myeclipse ), next is all the way.
The installation of other software is not always done. The following creates a simple project to describe the application of myeclipse.
3. Create a WEB Project
Open the myeclipse development interface, file-> New-> projects ..., Open the Create Project dialog box, select myeclipse-> J2EE projects-> Web project, click Next, and enter webtest in the projects name of web project details. The default value is used for other items, note that the context root URL here is/webtest. Otherwise, you must enter the corresponding name in IE to use it. Check whether the tag library is supported at the bottom. Choose jstl1.1. Click Finish to create the project.
4. Create a hello class
Select the SRC folder under the project webtest (Note: If this folder cannot be found under package explorer, go to the eclipse User Guide, window-> show view-> package Explorer ), right-click a package and choose new> package to create a new package. specified resky. bean. Select the new package, right-click New> class, and enter hello in name to remove the public static void main option. All others are default. Click Finish to create the class.
The Edit class code is as follows:
PackageCom. Alibaba resky. Bean;
PublicClassHello {
PrivateString message = "Hello World ";
/**
*@ ReturnReturns the message.
*/
PublicString getmessage (){
ReturnMessage;
}
/**
*@ ParamMessage the message to set.
*/
PublicVoidSetmessage (string message ){
This. Message = message;
}
}
Note that the bean attribute operation method can define the attributes first. Then, right-click the edit window and choose source> Generate getters and setters, in the dialog box, select the property of the get and set methods to be generated to confirm.
5. Create a JSP page
In the webtest project, select the webroot folder, right-click the menu New-> JSP, and change the file name to index. jsp. By default, click Finish to create the folder.
6. Configure the Tomcat server
Eclipse menu, window-> preference ..., Open the preference dialog box and find myeclipse in the menu tree.
Application Servers-> Tomcat 5. Select Tomcat
Five items. In the dialog box, select the enable radio button and click Tomcat home directory.
Enter the Browse button in the box and select the installation root directory of Tomcat. Here is D:/tomcat5.5. Other boxes will be automatically filled. Click Apply.
Select JDK in Tomcat 5. Note that the default runtime environment is JRE. Set it to JDK. Otherwise, myeclipse cannot be a web application, the Tomcat server cannot run normally. Click the Add button to write data to JDK in JRE name. 1.5.0 _ 05,
Then select the JDK root directory in the Browse selection box. Here is D:/jdk1.5.0 _ 05. For other default directories, click OK. In the Tomcat JDK
In name, select the one we just created, that is, JDK 1.5.0 _ 05. Click the Apply button. Click it every time. Sometimes there is a problem with eclipse. If you don't click this button, you can run to another configuration item.
The configuration above will be lost when the page is set.
Make sure that the debug mode is selected in the launch of Tomcat 5.
Now you can click the OK button in the preference dialog box to complete tomcat configuration.
VII. SubordinatesWebApplications
Find
(The one on the left of this button is the redeployment button, and the browser on the right is the built-in one). Click the drop-down button, select Tomcat 5, and click the Start menu to start Tomcat.
This is simple. Right-click the root directory of the webtest project and choose myeclipse> add and remove projects.
Deployments ..., In the displayed dialog box, make sure projects is webtest. Click Add and select tomcat in the server dialog box.
5. The following two single options: exploaded archive and packaged
Archive is directory-based and package-based, respectively. This is done by myeclipse. We use directory-based Deployment instead of making war packages. Click
The finished button returns to the previous page.
OK. The program has been deployed. Run and debug the program below.
8. Run the debugging program
Find
(The one on the left of this button is the redeployment button, and the browser on the right is the built-in one). Click the drop-down button, select Tomcat 5, and click the Start menu to start Tomcat.