Part 5: Performing Local Debugging

Before you can debug your servlet, you must:

  1. From the Forte toolbar, select the Editing tab.
  2. From the Explorer, double click to select the HelloServlet node open it in the Source Editor.
  3. Select the out.println("<h1>Hello Everyone from " + greeting +"!</h1>"); line in the editor.
  4. Right click and select Add/Remove Breakpoint from the context menu.

    The line appears highlighted in red indicating the location is set with a breakpoint.

  5. From the Explorer, select the HelloServlet node.
  6. From the Debug menu, select Start Debugging.

    The KJS process launched in Part 4 is killed. After a moment, a debugger message appears indicating that the iPlanet Server engine is restarting. Then, after another moment, a new KJS process is started in the Execution window. Also, the Output window deployment messages appear indicating the WebModule WAR file is created and deployment is finished.

    Additionally, the HelloServlet file displays in the Source Editor with the current breakpoint line displayed in blue.

  7. From the Debug window, select Variables tab.
  8. Locate the greeting variable and change the value to "iPlanet".

  9. From the toolbar, select Continue to finish executing your servlet.

    The resulting servlet is displayed in the Forte web browser. Notice that the greeting variable now appears as "iPlanet".

  10. From the Debug menu, select Finish Debugging.

    The Finish Debugging window appears.

  11. Select OK to stop the KJS process in the debugger.

    Congratulations, you have successfully debugged your servlet on a local server.

    You can also debug a deployed EJB in this same manner. Simply set breakpoints in the EJB classes and execute the servlet in debug mode. The application server will then stop on the breakpoints you set in the EJB classes.

See also
  Creating a Session Entity Java Bean

Legal Notices