Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Web Tools Guide
Previous Page Home Next Page

Debugging a servlet on a server

The debugger enables you to detect and diagnose errors in your application. It allows you to control the execution of your program by setting breakpoints, suspending threads, stepping through the code, and examining the contents of the variables. You can debug a servlet on a server without losing the state of your application.

To debug a servlet on a server:
  1. In the Project Explorer view, open your servlet. In a Web project, servlets are located in the JavaSource folder. The servlet opens in an editor.
  2. To set one or more breakpoints in the editor, double-click in the margin beside the line of code that you want to set as a breakpoint.
  3. Ensure the project is associated to run on a server.
  4. Select the servlet and from the servlet's context menu in the Project Explorer view, click Debug As > Debug on Server. Open the Servers view to see that the server is launched.
  5. When the breakpoint is hit, the Debug view opens. Step through the code, inspect and display variables, and make any necessary changes to the servlet. For detailed information on debugging, refer to the online help.
  6. When you are finished debugging, remove the breakpoint and save the servlet.
  7. Click the Resume icon on the Debug toolbar to execute the servlet.
  8. If you have hot method replace enabled, your changes are already in the running application.
  9. If you have automatic class reloading enabled, which is the default setting, click the Refresh icon in the Web Browser to update the changes. You do not lose the state of your application.
  10. If you do not have automatic class reloading enabled, you lose the state of the application. To update the changes, restart the server.
Result:

The server recognizes your changes.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire