You must create a custom JSP file to format the content
of your Atom feed. Each noun must have an associated feed formatting
JSP file. The RESTful framework uses this JSP file when converting
the SDO to an Atom feed. You must register your custom feed formatting
JSP file in a Struts configuration file so that the JAX-RS provider
Java class uses the correct JSP file to create the feed.
Before you begin
Review the following topics to understand the purpose and
function of feed formatting JSP files and the Struts configuration
file:
Procedure
- Open
WebSphere Commerce Developer and switch to the Enterprise Explorer
view.
- Create the feed formatting JSP files for the Atom feed.
You can create one JSP file that performs all the required configuration
and formatting functions, or split the functions between a series
of JSP files.
- Create a directory in which to store your custom JSP
file.
The directory must be at the following path:
WCDE_installdir/workspace/Rest/WebContent/
Tip: The
Atom feed formatting JSP files shipped with WebSphere Commerce are
stored in the Atom directory at the previous
path (that is, WCDE_installdir/workspace/Rest/WebContent/Atom).
To keep all Atom feed formatting JSP files together, consider storing
your custom files in a subdirectory within the Atom directory.
- Create a JSP file with a name like
Serializenoun_nameAtom.jsp
,
for example, SerializeCatalogGroupAtom.jsp. If
you are splitting the functions between a series of JSP files, add
a suffix to each file name to identify its function.
- Define the contents of the feed formatting JSP file
so that it gets the SDO and produces a valid output according to the
Atom Syndication Format 1.0 specification.
- Save and close the JSP file.
- Open the Struts configuration file for the RESTful framework
at the following path:
WCDE_installdir/workspace/Rest/WebContent/WEB-INF/struts-extension.xml
- Add a new action mapping to register the JSP file. If
you have created a series of JSP files, register only the top-level
JSP file.
- Save and close the file.
- Restart the WebSphere Commerce test server to make the
new configuration available.