mirror of
https://github.com/apache/struts.git
synced 2026-08-05 22:56:59 +00:00
- added xwork-conversion.xml, uncommented the block xwork.xml
- improved conversion example, such that a series of text field is generated dynamically rather that statically like previously - added conversion example link to showcase.jsp git-svn-id: https://svn.apache.org/repos/asf/struts/action2/trunk@413024 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -36,9 +36,7 @@
|
||||
|
||||
<include file="xwork-filedownload.xml" />
|
||||
|
||||
<!--
|
||||
<include file="xwork-conversion.xml" />
|
||||
-->
|
||||
|
||||
<include file="xwork-freemarker.xml" />
|
||||
|
||||
|
||||
@@ -21,7 +21,22 @@ See the code for Person.java <saf:url id="url" action="showPersonJavaCode" names
|
||||
<saf:fielderror />
|
||||
|
||||
<saf:form action="submitPersonInfo" namespace="/conversion" method="post">
|
||||
<%--
|
||||
The following is done Dynamically
|
||||
--%>
|
||||
<saf:iterator value="new int[3]" status="stat">
|
||||
<saf:textfield label="%{'Person '+#stat.index+' Name'}"
|
||||
name="%{'persons['+#stat.index+'].name'}" />
|
||||
<saf:textfield label="%{'Person '+#stat.index+' Age'}"
|
||||
name="%{'persons['+#stat.index+'].age'}" />
|
||||
</saf:iterator>
|
||||
|
||||
|
||||
|
||||
<%--
|
||||
The following is done statically:-
|
||||
--%>
|
||||
<%--
|
||||
<saf:textfield label="Person 1 Name"
|
||||
name="persons[0].name" />
|
||||
<saf:textfield label="Person 1 Age"
|
||||
@@ -34,8 +49,7 @@ See the code for Person.java <saf:url id="url" action="showPersonJavaCode" names
|
||||
name="persons[2].name" />
|
||||
<saf:textfield label="Person 3 Age"
|
||||
name="persons[2].age" />
|
||||
|
||||
|
||||
--%>
|
||||
|
||||
<saf:submit />
|
||||
</saf:form>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
<body>
|
||||
|
||||
<saf:iterator value="persons" status="status">
|
||||
<saf:label label="%{#status.index+' Name'}" value="%{name}" /><br/>
|
||||
<saf:label label="%{#status.index+' Age'}" value="%{age}" /><br/>
|
||||
<saf:label label="%{'SET '+#status.index+' Name'}" value="%{name}" /><br/>
|
||||
<saf:label label="%{'SET '+#status.index+' Age'}" value="%{age}" /><br/>
|
||||
</saf:iterator>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -57,6 +57,9 @@
|
||||
<!-- model-driven -->
|
||||
<li><saf:url id="url" action="modelDriven" namespace="/modelDriven" method="input"/><saf:a href="%{url}">Model Driven Example</saf:a>
|
||||
|
||||
<!-- conversion -->
|
||||
<li><saf:url id="url" value="/conversion" /><saf:a href="%{url}">Conversion Example</saf:a></li>
|
||||
|
||||
<!-- freemarker -->
|
||||
<li><saf:url id="url" value="/freemarker" /><saf:a href="%{#url}">Freemarker Example</saf:a></li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user