mirror of
https://github.com/apache/struts.git
synced 2026-08-31 19:35:40 +00:00
- added an example of using <saf:component ... /> tag
- show templating using jsp and freemarker git-svn-id: https://svn.apache.org/repos/asf/struts/action2/trunk@413295 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<div style="background-color:yellow;">
|
||||
<p>
|
||||
Freemarker Custom Template -
|
||||
parameter 'paramName' - ${parameters.paramName}
|
||||
</p>
|
||||
</div>
|
||||
@@ -50,6 +50,11 @@
|
||||
|
||||
<!-- END SNIPPET: treeExampleDynamicXWorkXml -->
|
||||
|
||||
|
||||
<action name="showComponentTagExampleCode">
|
||||
<result type="plaintext">/tags/ui/componentTagExample.jsp</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
||||
<!-- START SNIPPET: treeExampleXWorkXml -->
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
<div style="background-color:yellow;">
|
||||
<p>
|
||||
Freemarker Custom Template -
|
||||
parameter 'paramName' - ${parameters.paramName}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<%@taglib prefix="saf" uri="/struts-action" %>
|
||||
|
||||
<div style="background-color:yellow;">
|
||||
<p>
|
||||
JSP Custom Template -
|
||||
parameter 'paramName' - <saf:property value="%{top.parameters.paramName}" />
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,62 @@
|
||||
<%@taglib prefix="saf" uri="/struts-action" %>
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>Showcase - Tags - UI Tags - Component Tag</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
This example tries to demonstrates the usage of <saf:component ... > tag.
|
||||
<p/>
|
||||
|
||||
To have a look at the source of this jsp page click
|
||||
<saf:url id="url" action="showComponentTagExampleCode" namespace="/tags/ui"/>
|
||||
<saf:a href="%{#url}">here</saf:a>
|
||||
<p/>
|
||||
|
||||
<b>Example 1:</b>
|
||||
This example load the template from the webapp context path using
|
||||
the default (ftl) as its template.
|
||||
<saf:component
|
||||
theme="customTheme"
|
||||
templateDir="customTemplateDir"
|
||||
template="ftlCustomTemplate">
|
||||
<saf:param name="paramName" value="%{'paramValue1'}" />
|
||||
</saf:component>
|
||||
<p/>
|
||||
|
||||
<b>Example 2:</b>
|
||||
This example load the template from the webapp context path using
|
||||
jsp as its template (notice the *.jsp extension to the template).
|
||||
<saf:component
|
||||
theme="customTheme"
|
||||
templateDir="customTemplateDir"
|
||||
template="jspCustomTemplate.jsp">
|
||||
<saf:param name="paramName" value="%{'paramValue2'}" />
|
||||
</saf:component>
|
||||
<p/>
|
||||
|
||||
<b>Example 3</b>
|
||||
This example load the template from the webapp context path,
|
||||
using the default template directory and theme (default to
|
||||
'template' and 'xhtml' respectively)
|
||||
<saf:component template="mytemplate.jsp">
|
||||
<saf:param name="paramName" value="%{'paramValue3'}" />
|
||||
</saf:component>
|
||||
<p/>
|
||||
|
||||
|
||||
<b>Example 4</b>
|
||||
This example load the template from the webapp classpath using
|
||||
a custom themplate directory and theme.
|
||||
<saf:component
|
||||
theme="myTheme"
|
||||
templateDir="myTemplateDir"
|
||||
template="myAnotherTemplate">
|
||||
<saf:param name="paramName" value="%{'paramValue4'}" />
|
||||
</saf:component>
|
||||
<p/>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<li><saf:url id="url" namespace="/tags/ui" action="lotsOfRichtexteditor" method="input" /><saf:a href="%{url}">Rich Text Editor UI Example</saf:a></li>
|
||||
<li><saf:url id="url" namespace="/tags/ui" value="treeExampleStatic.jsp" /><saf:a href="%{url}">Tree Example (static)</saf:a>
|
||||
<li><saf:url id="url" namespace="/tags/ui" action="showDynamicTreeAction"/><saf:a href="%{url}">Tree Example (dynamic)</saf:a>
|
||||
<li><saf:url id="url" value="componentTagExample.jsp"/><saf:a href="%{#url}">Component Tag Example</saf:a>
|
||||
<%--li><saf:url id="url" namespace="/tags/ui" action="populateUsingIterator" method="input" /><saf:a href="%{url}">UI population using iterator tag</saf:a></li--%>
|
||||
</ul>
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
<%@taglib prefix="saf" uri="/struts-action" %>
|
||||
|
||||
<div style="background-color:yellow;">
|
||||
<p>
|
||||
JSP Custom Template -
|
||||
parameter 'paramName' - <saf:property value="%{parameters.paramName}" />
|
||||
</p>
|
||||
</div>
|
||||
Reference in New Issue
Block a user