Develop > Presentation layer > Work with Web service feeds > Create a custom feed from a Web service
Create the Atom feed representation of the service
You must create a custom JSP file to format the content of the 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. Register the 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:
- Feed formatting JSP files for Atom feeds
- Struts configuration for specifying Atom feed formatting JSP files
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 the custom JSP file. The directory must be at the following path:
WCDE_INSTALL/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_INSTALL/workspace/Rest/WebContent/Atom). To keep all Atom feed formatting JSP files together, consider storing the 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. See the guidelines and examples in Feed formatting JSP files for Atom feeds.
- Save and close the JSP file.
- Open the Struts configuration file for the RESTful framework at the following path:
WCDE_INSTALL/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. See the guidelines and examples in Struts configuration for specifying Atom feed formatting JSP files.
- Save and close the file.
- Restart the WebSphere Commerce test server to make the new configuration available.
Previous topic: Define the URL and creating the Java class for the feed
Next topic: Test, exposing, and deploying the Atom feed
Related concepts
WebSphere Commerce Struts framework
Struts configuration for specifying Atom feed formatting JSP files