16.5 Running the portlet

 < Day Day Up > 

Once the portlet has been installed in WebSphere Portal, you will need to connect to the server in Debug mode. If required, you can also trace the execution of the portlet program by using debugging facilities such as breakpoints and so on.

  1. To run a project using the Remote Server Attach, you will need to add the portlet project to the remote server.

    1. Click the Server Configuration tab (on the navigator panel).

    2. Expand the Servers tree.

    3. Right-click Test Remote Server Attach .

    4. Click Add -> DefaultEAR (or any other project that you want to run) to add your project to the remote server.

  2. In the Servers view, right-click the server and select Debug to connect to the remote server.

    Figure 16-31. Debugging remotely

    graphics/16fig31.jpg

  3. The server status should change to Connected in debug mode and the server will be ready for portlet debugging using the Debug perspective.

    Figure 16-32. Connected in Debug mode

    graphics/16fig32.jpg

  4. As an example, set a breakpoint in the doConfigure() method in the HelloWorld portlet (see Figure 16-33). That is, right-click the selected statement and click Add Breakpoint .

    Figure 16-33. Setting a breakpoint in doConfigure() method

    graphics/16fig33.jpg

  5. Start debugging the portlet application by launching a new external browser (IE) and log in to WebSphere Portal. For example, for this scenario use the following values:

    1. http://portaldev.itso.ral.ibm.com:9081/wps/portal

    2. User ID is padmin and password is its0lab .

  6. Navigate to execute the portlet: My Portal -> My Label -> New Page .

  7. Initially, you will receive the Step-by-Step Debug window. At this time, you may want to skip the doGet method with the request as well as disable the step-by-step mode.

    Figure 16-34. Step-by-Step Debug window

    graphics/16fig34.jpg

  8. When a breakpoint is reached, you will see a window similar to Figure 16-35 on page 499. It shows the breakpoint and you can also inspect your variables .

    Figure 16-35. Debugging the portlet

    graphics/16fig35.jpg

    Note : The process of debugging portlet applications is the same as for Web applications. You control and trace the execution of the portlet since you can set breakpoints in Java source code and JSPs.

  9. Click the triangle in the Debug menu bar to resume execution of the portlet.

    Figure 16-36. Debug window

    graphics/16fig36.jpg

  10. You can disconnect the remote WebSphere Portal by right-clicking the server name in the Servers view and clicking Disconnect .

Figure 16-37. Disconnecting from the Remote Server Attach

graphics/16fig37.jpg

 < Day Day Up > 


IBM WebSphere Portal V5 A Guide for Portlet Application Development
IBM Websphere Portal V5: A Guide for Portlet Application Development
ISBN: 0738498513
EAN: 2147483647
Year: 2004
Pages: 148

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net