Creating and registering a serialization JSP file for the price rule element
Before you begin
About this task
When a business user opens a price rule, the parent serialization JSP file, GetPriceRuleElements.jsp, calls the serialization JSP file for each price rule element to load the data for the price rule.
If the object definition for your new price rule element includes wcfChildObjectDefinitions or wcfReferenceObjectDefinitions, you must create a new serialization JSP file for your new price rule element; otherwise, you can use the existing generic serialization JSP file, SerializePriceRuleCommonElement.jsp, as is. In both cases, you must register the serialization JSP file in the Spring configuration file for customization, spring-ibm-price.xml. This file is initially empty and takes precedence over all Spring configuration files.
Procedure
- Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
-
If you need a new serialization JSP file, complete the following steps; otherwise, skip to step
3:
-
Open the Spring configuration file, spring-ibm-price.xml.
The file is stored at this path:
LOBTools/WebContent/WEB-INF
-
Add a new action mapping to register the serialization JSP file:
- If you created your own serialization JSP file, your action mapping should use the following
syntax:
<action path="/SerializePriceRuleElement-objectType_value" include="/jsp/your_company_name/price/name_of_serialization_jsp_file.jsp" />
where
objectType_value
is the value of the objectType attribute defined in the object definition for this price rule elementname_of_serialization_jsp_file
is the name you gave to the custom serialization JSP file for your new price rule element in an earlier step of this procedure.
- If you are using the generic serialization JSP file, your action mapping should use the
following
syntax:
<bean id="/SerializePriceRuleElement-objectType_value" class="org.springframework.web.servlet.mvc.ParameterizableViewController"> <property name="viewName" value="/jsp/commerce/price/restricted/serialize/SerializePriceRuleCommonElement.jsp"/> </bean>
Here are a couple of tips:- If you copied code from an existing serialization JSP file, you must update the paths as appropriate for any included JSP files.
- If you change your serialization JSP file, make sure to edit the GetPriceRuleElements.jsp file. You do not need to make any changes to the GetPriceRuleElements.jsp file; just save it to change the file modification timestamp. The GetPriceRuleElements.jsp file includes the serialization JSP files, so this will ensure that your serialization JSP file changes are picked up.
- If you created your own serialization JSP file, your action mapping should use the following
syntax:
-
Restart the WebSphere Commerce test server to make the new configuration available.