In the previous two articles have been a lot of setup problems (reference: 1. Eclipse 3 Lomboz 3 Tomcat 5 Develop Website 2.eclipse, Lomboz and Tomcat Web Project Settings), in fact, if the previous settings are no problem, debugging It is very simple, water to the stream.
It is necessary to explain a little before writing, and the compiled procedures are all known, and there should be two types, compiling faults and running faults. Nowadays, the popular IDE can almost I can find most of the compilation error when editing. Then give you a prompt. Eclipse is no exception. When writing the Java program, the edit box is on the red dot, the yellow point is. After loading Lomboz, JSP's compilation fault can also be prompted. This type of fault does not debug, and it is not possible. It is directly changed.
Another category is running fault, this is trouble, it is not easy to find, remember in the ASP era, we always find the error until Visual Studio .NET 2003 cannot track ASPX execution (of course, Code Behind can, but The code in the APSX page does not have to do this. When there is no Lomboz, it is also out.print, it is really tiring.
A pile of nonsense and began to talk about the topic. (Today, I changed the set machine, using the Final version of Eclipse 3, the details of the screen copy may be a bit different, it should be not a problem)
There is an important setting before starting Tomcat, builds a Tomcat configuration file for your web project, where the conf / catalina / localhost under the Tomcat directory, the file can be arbitrarily name, but must use XML extension (in short To comply with Tomcat's rules). The content of the configuration file is simple, such as my Project called Blog, the content of the configuration file (blog.xml) is:
Just a line, you can also put it in Server.xml, there is no time to talk about Tomcat here.
Finally, start Tomcat, point the gear button.
This is the prompt information after Tomcat startup:
The following steps are important. After Tomcat starts, open the browser, enter the adaptive page address, such as: http: // localhost: 8080 / test / index.jsp, my test page index is like this.
Back to Eclipse, right click on the project name, then select the new menu, refresh the entire project's file. At this time, Magic appeared, there is something under J2SRC, followed by the directory to h: / project / blog / j2src / org / apache / jsp, you can see what you want. Index_jsp.java, index._jsp.class. Open index_jsp.java (he is Tomcat to generate servlet according to your JSP file, debugging), set up breakpoints. Cut back IE, refresh the page, the Eclipse of the taskbar flashes, cut back Eclipse, he has stopped at the breakpoint.
See the value of Template? It is necessary to change him, I can't think of it in JSP.
In addition, those BEAN's debugging is relatively simple, like a general Java file, it is no longer rushed.
There is a bit more here, summarize:
Pay attention to that only one line of profile (blog.xml), it is very payable. Before debugging the JSP file, run him first, let Tomcat generate his servlet, and we want to debug it is a servlet remember to refresh your Project, see those dynamically generated servlet files, and then break the point.
Pay attention to these details, everyone exchanges.
Refer to my revision (2004.10.11): Eclipse 3 Lomboz 3 Tomcat 5 (4) Revision and Supplement
Then, the article about Eclipse, Lomboz and Tomcat series is whose origin, transaction, or reference, please indicate.
At this point, my article about Eclipse, Lomboz and Tomcat is a paragraph, in fact, there is still a lot of things to write (the database part is not written), but because it is relatively busy, it will not be able to make details. If you find the problem, you can communicate in the message.