Develop > Presentation layer > Work with JSP pages > WebSphere Commerce JSP viewer > Create XML files using the XMLGenerator


Configure the JSP viewer

The Web controller in the JSP viewer provides JSP pages with linkages to other JSP pages. Without a WebSphere Commerce environment, the HTML links in the JSP pages would not work. The Web controller mimics WebSphere Commerce run time using a XML configuration file.


Procedure

  1. Open the WCDE_preview_installdir/wcsstore/WebContent/WEB-INF/registry.xml file.

  2. Create the entries in the registry.xml by using the <entry> tag in the following example:

    <entry url="AdvancedB2BDirect/index" jsp="AdvancedB2BDirect/UserArea/AccountSection/LogonSubsection/UserLogonForm.jsp" />
    

    In the preceding example, the URL points to the UserLogonForm.jsp file which is the main entry point into the store. The default URL to this page is http://localhost:9080/wcsstore/servlet/AdvancedB2BDirect/index. It is important to note that the Web controller is only configured to understand URLs that have the /wcsstore/servlet prefix, meaning that the JSP pages should not have hard coded contexts in them. For example, creating a link in a JSP page that points to /webapp/wcs/stores/servlet/ProductDisplay would not be a valid link in this environment whereas, just using ProductDisplay would be a valid one.

    <entry url="AdvancedB2BDirect/ProductDisplay?catalogId=&amp;storeId=10051&amp;langId=-1&amp;productId=10274" jsp="AdvancedB2BDirect/ShoppingArea/CatalogSection/CatalogEntrySubsection/ItemDisplay.jsp" />

    In the preceding example, there is an alternative method to matching URLs. In this case, a set of parameters has been appended to the URL. The Web controller will first attempt to match to the more explicit URL before using the more general one.

    The CommandContext.xml file is configured using the BeanLocation.xml file. There must be a CommandContext entry in that file. The location of the CommandContext.xml (or equivalent) is then located using that configuration file. The file name for CommandContext should always be called CommandContext.xml and the file must be located in the WCDE_preview_installdir /wcsstore/WebContent/WEB-INF/classes directory.


Previous topic: Set up the JSP viewer tool


Next topic: Modify the data bean location XML file


Related concepts

WebSphere Commerce JSP viewer


Related tasks

Create XML files using the XMLGenerator


+

Search Tips   |   Advanced Search