Develop > Presentation layer > Work with JSP pages > Storefront customization tools > Web application
Represent view implementations: action-mappings and global-forwards
Describing device and store specific view implementations in Web application with a combination of the elements...
- action-mappings
- global-forwards
In earlier versions of WebSphere Commerce one used the VIEWREG table.
Views
AddressBookForm
Device format ID -1 Store ID 0 View command interface com.ibm.commerce.command.ForwardViewCommand View command implementation class com.ibm.commerce.command.HttpForwardViewCommandImpl Properties docname= Address-BookForm.jsp HTTPS 0 Credentials Accepted NULL
AddressBookForm
Device format ID -1 Store ID 201 View command interface com.ibm.commerce. command.ForwardViewCommand View command implementation class com.ibm.commerce.command.HttpForwardViewCommandImpl Properties docname=UserArea/AccountSection/AddressbookSubsection/AddressBookForm.jsp HTTPS 1 Credentials Accepted P
GenericPassword-ErrorView
Device format ID -1 Store ID 0 View command interface com.ibm.commerce.command.ForwardViewCommand View command implementation class com.ibm.commerce.command.HttpForwardViewCommandImpl Properties docname=Generic-Application-Error.jsp&storedir=no HTTPS 0 Credentials Accepted NULL
CompleteOrderView
Device format ID -3 Store ID 201 View command interface com.ibm.commerce.messaging.viewcommands. MessagingViewCommand View command implementation class com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl Properties docname=CompleteOrder.jsp HTTPS 0 Credentials Accepted NULL
...where...
The following configuration fragment describes the first three associations:
<global-forwards> <forward name="AddressBookForm" path="/AddressBookForm.jsp" /> <forward className="com.ibm.commerce.struts.ECActionForward" name="AddressBookForm/201" path="/UserArea/AccountSection/AddressbookSubsection/AddressBookForm.jsp"> <set-property property="resourceClassName" value="com.ibm.commerce.command.HttpForwardViewCommandImpl" /> </forward> <forward className="com.ibm.commerce.struts.ECActionForward" name="GenericPasswordErrorView" path="/GenericApplicationError.jsp"> <set-property property="properties" value="storeDir=no" /> <set-property property="resourceClassName" value="com.ibm.commerce.command.HttpForwardViewCommandImpl" /> </forward> </global-forwards> <action-mappings type="com.ibm.commerce.struts.ECActionMapping"> <action path="/AddressBookForm" type="com.ibm.commerce.struts.BaseAction"> <set-property property="https" value="0:0,201:1" /> <set-property property="credentialsAccepted" value="201:P" /> </action>
<action path="/GenericPasswordErrorView" type="com.ibm.commerce.struts.BaseAction" />
</action-mappings>
Notes:
- The value of the className attribute of the forward elements.
- The syntax of the name attribute of the forward elements: a docname/ storeID pair, whose second constituent defaults to 0.
- The use of the resourceClassName property to specify the view command implementation class, whose value defaults to com.ibm.commerce.command.HttpForwardViewCommandImpl.
- You can also set the authenticate property for views, with the same syntax and semantics as for URLs (described in the preceding section).
- The final row of the preceding table represents a messaging view, which is an example of a view that is not intended to be rendered by a browser and requires variant syntax to specify the device type as well as special properties to specify the implementation for generating the response:
<global-forwards> <forward className="com.ibm.commerce.struts.ECActionForward" name="CompleteOrderView/201/-3" path="/AuctionArea/Messages/CompleteOrder.jsp"> <set-property property="implClassName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommandImpl" /> <set-property property="interfaceName" value="com.ibm.commerce.messaging.viewcommands.MessagingViewCommand" /> </forward> </global-forward> <action-mappings type="com.ibm.commerce.struts.ECActionMapping"> <action path="/CompleteOrderView" type="com.ibm.commerce.struts.BaseAction" /> </action-mapping>
- The extension to the syntax of the name attribute of the forward element: a docname/ storeID / deviceFormatID triplet, whose third constituent defaults to -1.
- To identify the correct values for the messaging composition service refer to Create an outbound message.
- The use of the implClassName property to specify the view command implementation class and of the interfaceName property to specify the view command interface. Only use this property to define access control policies based on view implementations, it is provided for compatibility with previous versions of WebSphere Commerce.