Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

JSP tags are extensions of the generic tags provided by the framework. You can get started almost immediately by simply knowing the generic structure in which the tags can be accessed: <s:tag> ... </s:tag>, where tag is any of the tags supported by the framework.

Tag Library Definition (TLD)

The JSP TLD is included in the struts-core.jar. To use, just include the usual red-tape at the top of your JSP.

Note
titleNote

JSP Templates must be accesible from from context path. Example if a Jsp Template is /myTemplates/myTheme/myComponent.jsp, it needs to be placed in the context-path of the webapplication. Placing them in the classpath will not work. It works for Velocity and Freemarker templates but not Jsp templates.

Syntax

Jsp template is scripted just like a normal jsp would.

To get the stack, the WebWork's set tag could be used. The following will get context object with id 'myContextObjId' and put it into page scope under 'myPageObjId'.

Code Block
xml
xml
<%@   <ww:set nametaglib prefix="myPageObjIds" valueuri="#myContextObjId" scope="page" />

The Component resulting in the execution of the Jsp Template will be pushed into the top of the stack before the Jsp template is included. Hence, to get say for example the a parameter with name 'myParamName', WebWork's property tag could be used.

Code Block
xmlxml

   <ww:property value="parameters.myParamName" /> /struts-tags" %>
<html>
  <body>
    <p>Now you can use the tags, like so:</p>
    <s:iterator value="people">
      Or
   <ww<s:property value="lastName"/>, <s:property value="parameters['myParamName']" />

...

firstName"/>
    </s:iterator>
    ...

Next: Freemarker