Lesson 3: Editing and testing an existing JSF page

In this lesson, you modify a JSF page that is already in the project and test the modified JSP page in the runtime server.

  1. In Workspace Navigator, expand SybStore_Tutorials_Web/webroot, right-click entrypage.jsp, and select Open With|Web Page Editor.

    The top section of the editor displays a graphical view of the design page and the bottom section displays its source code.

  2. Select Window|Show View|Palette from the main menu bar.

    NoteIf Palette in not in the list, select Other. When the Show View dialog box opens, select Basic|Palette and click OK. If the Palette disappears, reselect it from the menu or click the Palette icon on the Fast View shortcut bar. For more information, see the Sybase WorkSpace Development online help topic Fast View Shortcut Bar.

  3. In the Palette, expand JSF HTML.

  4. Select the CommandLink control and drag and drop it to the right of Restock Request on the design page.

  5. Right-click CommandLink in the graphical section and select Show View|Properties from the context menu to open the Properties view.

  6. Select CommandLink in the graphical section.

  7. Type Orders in the Value field of the Properties view.

  8. Select Orders in the graphical section and press the left arrow key twice to move the cursor to the h:commandLink in the source code to display the values in Properties.

    You should see “h:commandLink” displayed on the Properties view toolbar.

  9. Type Orders in the Action field of the Properties view.

  10. Select File|Save from the main menu bar to save the page, then click the Preview tab at the bottom of the editor to preview the modified page.

    You have added a new command link to the Web page. Now you can test the modified page on the runtime server.

  11. Select File|Close from the main menu bar to close the entrypage.jsp page in the editor.

  12. In the WorkSpace Navigator, right-click MySybStore_Tutorials_Web/webroot/entrypage.jsp and select Run from the context menu.

  13. When the Run On Server wizard opens, select Choose an existing server and select MyAppServer as the server you want to use. Click Finish to load the page in the browser.

    NoteWhen the page appears in the browser, if you do not see the Orders link at the bottom of the page, right-click the page and select Refresh from the context menu.

  14. Select File|Close from the main menu bar to close the page in the browser.

You have finished modifying an existing JSP page and previewed the updated Web page on an actual Web server to test it.