JSP filters allow you to write custom code to post-process portlet content using programming. When you create JSP filters, you look at a portlet’s content, enter the Java code to transform the content in any way you want, then save the code as a JSP template, which you can later select for post-processing.
Selecting a JSP filter
Log in to Web Studio and select Build | Applications from the menu in the left pane.
In the detail pane, right-click the application to which you want to add post-processing and select Edit from the pop-up.
When the Application Builder displays, right-click the portlet to which you want to add a JSP Filter and select Create JSP Filter from the pop-up.
The JSP Editor appears with a preview of the portlet.
Complete these options:
JSP Template – enter the name of an existing JSP template you want to use or click Select to search for a template using the Find JSP Template dialog box.
Click Search to display existing approved JSP templates. When the list appears in the Results pane, select:
New – to create a new JSP template.
Edit – to modify the template selected in the Results pane.
Select – to choose the template selected in the Results pane.
Preview – to preview the template selected in the Results pane.
Apply JSP Filter to XML Playback – select this option to apply the filter only when the portlet’s content is returned as XML. When this option is not selected, which is the default, the filter is applied only when the portlet’s content is returned as HTML.
When portlets are played back, they return their content
in either HTML or XML. Whether HTML or XML is returned is determined
by the entity making the request.
For example, when Portal Interface requests that portlet A be played back, the output is requested as HTML. When an agent requests that sample portlet A be played back, the output is requested as XML. When you create a JSP filter and attach the filter to a portlet for post-processing, the developer uses this option on a case-by-case basis to apply or not apply the JSP filter during portlet playback.
Click Finish to associate the JSP Filter with the selected portlet.
You can add more than one JSP filter as post-processing elements on a portlet and you can apply the same JSP filters to numerous portlets. When the JSP filters have been added, the portlet is saved under the same version, regardless of how the global versioning property is set. Once you assign a JSP filter for portlet post-processing, the filter is listed in the Application Builder under the portlet name.
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |