Bruce Ritchie sent me a bugfix for PropertyTag a while back when I was
working on it that unfortunately never reached me. Fortunately this was
cleared up when he appeared on irc so I've made a diff of this change
(tested on my machine I might add).
I have also corrected the jsp reference page somewhat. The docs on the
property tag now actually describes what it does :P. These changes are also
attached to this email as a diff. Since I no longer have commit access I
can't fix this in CVS myself.
// Anders Hovm�ller
Index: BasicPropertyTag.java
===================================================================
RCS file:
/cvsroot/opensymphony/webwork/src/main/webwork/view/taglib/BasicPropertyTag.java,v
retrieving revision 1.1
diff -r1.1 BasicPropertyTag.java
130c130,142
< escape=null;
---
> // Bruce Ritchie
> // don't reset escape since some container implementations
>won't handle correctly
> // since escape property might not get set if it's the same
>value as the previous
> // call to the tag
> // see the jsp spec (1.2) section 10.1
> //
> //Once properly set, all properties are expected to be
>persistent, so that if the
> //JSP container ascertains that a property has already been
>set on a given tag
> //handler instance, it needs not set it again. User code can
>access property
> //information and access and modify tag handler internal state
>starting with the first
> //action method (doStartTag) up until the last action method
>(doEndTag or
> //doFinally for tag handlers implementing TryCatchFinally).
> //escape=null;
Index: tag.jsp
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/docs/manual/tag.jsp,v
retrieving revision 1.6
diff -r1.6 tag.jsp
50,52c50,52
< Browser:<webwork:property value="browser"/><br>
< Version:<webwork:property value="version"/><br>
< Supports GIF:<webwork:if test="supportsType('image/gif') ==
true">Yes</webwork:if><webwork:else>No</webwork:else><br>
---
> Browser:<webwork:property value="browser"/><br>
> Version:<webwork:property value="version"/><br>
> Supports GIF:<webwork:if test="supportsType('image/gif') ==
>true">Yes</webwork:if><webwork:else>No</webwork:else><br>
79,80c79,80
< <ww:property escape="true">
< <H1>Testing append, subset, and value generators</H1>
---
> <ww:property escape="true">
> <h1>Testing append, subset, and value generators</h1>
83,100c83,101
< <webwork:bean name="'webwork.util.Counter'">
< <webwork:param name="'last'" value="5"/>
< <webwork:iterator id="colcount">
< <tr>
< <iterator:generator val="'foo,bar,xyzzy'" separator="','" count="@colcount"
id="values"/>
< <iterator:generator val="' '" count="-1" id="space"/>
< <iterator:append>
< <webwork:param name="'source'" value="@values"/>
< <webwork:param name="'source'" value="@space"/>
<
< <iterator:subset count="6">
< <webwork:iterator>
< <td width=40><webwork:property/></td>
< </webwork:iterator>
< </iterator:subset>
< </iterator:append>
< </tr>
< </webwork:iterator>
---
> <webwork:bean name="'webwork.util.Counter'">
> <webwork:param name="'last'" value="5"/>
> <webwork:iterator id="colcount">
> <tr>
> <iterator:generator val="'foo,bar,xyzzy'" separator="','" count="@colcount"
>id="values"/>
> <iterator:generator val="' '" count="-1" id="space"/>
> <iterator:append>
> <webwork:param name="'source'" value="@values"/>
> <webwork:param name="'source'" value="@space"/>
>
> <iterator:subset count="6">
> <webwork:iterator>
> <td width="40"><webwork:property/></td>
> </webwork:iterator>
> </iterator:subset>
> </iterator:append>
> </tr>
> </webwork:iterator>
> </webwork:bean>
102d102
< </webwork:bean>
246c246
< <H1>Testing append, subset, and value generators</H1>
---
> <h1>Testing append, subset, and value generators</h1>
249,278c249,279
< <webwork:bean name="'webwork.util.Counter'">
< <webwork:param name="'last'" value="5"/>
< <webwork:iterator id="colcount">
< <tr>
<
< ************************************************************
< Generator will create an Iterator that has 5 items.
< The first 3 are "foo,bar,xyzzy". Item 4 and 5 will be
< foo and bar respectively. If the count is more than
< the items, you start over.
< ************************************************************
< <iterator:generator val="'foo,bar,xyzzy'" separator="','" count="@colcount"
id="values"/>
<
< ************************************************************
< Generator will create an Iterator that has infinite
< . Count=-1 means indefinite.
< ************************************************************
< <iterator:generator val="' '" count="-1" id="space"/>
< <iterator:append>
< <webwork:param name="'source'" value="@values"/>
< <webwork:param name="'source'" value="@space"/>
<
< <iterator:subset count="6">
< <webwork:iterator>
< <td width=40><webwork:property/></td>
< </webwork:iterator>
< </iterator:subset>
< </iterator:append>
< </tr>
< </webwork:iterator>
---
> <webwork:bean name="'webwork.util.Counter'">
> <webwork:param name="'last'" value="5"/>
> <webwork:iterator id="colcount">
> <tr>
>
> ************************************************************
> Generator will create an Iterator that has 5 items.
> The first 3 are "foo,bar,xyzzy". Item 4 and 5 will be
> foo and bar respectively. If the count is more than
> the items, you start over.
> ************************************************************
> <iterator:generator val="'foo,bar,xyzzy'" separator="','" count="@colcount"
>id="values"/>
>
> ************************************************************
> Generator will create an Iterator that has infinite
> . Count=-1 means indefinite.
> ************************************************************
> <iterator:generator val="' '" count="-1" id="space"/>
> <iterator:append>
> <webwork:param name="'source'" value="@values"/>
> <webwork:param name="'source'" value="@space"/>
>
> <iterator:subset count="6">
> <webwork:iterator>
> <td width="40"><webwork:property/></td>
> </webwork:iterator>
> </iterator:subset>
> </iterator:append>
> </tr>
> </webwork:iterator>
> </webwork:bean>
280d280
< </webwork:bean>
400c400
< <webwork:property/><br>
---
> <webwork:property/><br />
410c410
< <H1>Testing iterator status</H1>
---
> <h1>Testing iterator status</h1>
418,424c418,419
< <webwork:iterator value="@rowcounter" status="'rowstatus'">
< <tr>
<
< <webwork:bean name="'webwork.util.Counter'" id="colcounter">
< <webwork:param name="'first'" value="0"/>
< <webwork:param name="'last'" value="5"/>
< </webwork:bean>
---
> <webwork:iterator value="@rowcounter" status="'rowstatus'">
> <tr>
426,437c421,437
< <webwork:iterator value="@colcounter" status="'colstatus'">
< ************************************************************
< if it is (first row) or (first column) or (last row) then
< output the column number.
< ************************************************************
< <webwork:if test="@rowstatus/first==true || @colstatus/first==true ||
@rowstatus/last==true">
< <th><webwork:property value="@colstatus/count"/></th>
< </webwork:if>
< <webwork:else>
< <td><webwork:property/></td>
< </webwork:else>
< </webwork:iterator>
---
> <webwork:bean name="'webwork.util.Counter'" id="colcounter">
> <webwork:param name="'first'" value="0"/>
> <webwork:param name="'last'" value="5"/>
> </webwork:bean>
>
> <webwork:iterator value="@colcounter" status="'colstatus'">
> ************************************************************
> if it is (first row) or (first column) or (last row) then
> output the column number.
> ************************************************************
> <webwork:if test="@rowstatus/first==true || @colstatus/first==true ||
>@rowstatus/last==true">
> <th><webwork:property value="@colstatus/count"/></th>
> </webwork:if>
> <webwork:else>
> <td><webwork:property/></td>
> </webwork:else>
> </webwork:iterator>
439,440c439,440
< </tr>
< </webwork:iterator>
---
> </tr>
> </webwork:iterator>
452,453c452,453
< <webwork:if test="@status/odd == true"> <br> </webwork:if>
< <br>
---
> <webwork:if test="@status/odd == true"> <br /> </webwork:if>
> <br />
463,464c463,464
< <webwork:if test="@status/modulus(4) == 0"> <br> </webwork:if>
< <br>
---
> <webwork:if test="@status/modulus(4) == 0"> <br /> </webwork:if>
> <br />
491c491
< <webwork:text name="'main.title'"/>
---
> <webwork:text name="'main.title'"/>
520d519
< <br>
526,528c525,527
< <webwork:param name="'source'" value="@foo"/>
< <webwork:param name="'source'" value="@bar"/>
< <webwork:param name="'source'" value="@xyzzy"/>
---
> <webwork:param name="'source'" value="@foo"/>
> <webwork:param name="'source'" value="@bar"/>
> <webwork:param name="'source'" value="@xyzzy"/>
531,533c530,532
< <webwork:iterator status="'status'">
< <webwork:property value="@status/count"/>:<webwork:property/><br>
< </webwork:iterator>
---
> <webwork:iterator status="'status'">
> <webwork:property value="@status/count"/>:<webwork:property/><br>
> </webwork:iterator>
577,579c576,589
< <p>Used to retrieve a value and print it out. By default, it will escape HTML
< characters for tags with *no* bodies. Tags with bodies will not be escaped by
default.
< You can override this with explicit setting of the escape attribute.
---
> <p>The property tag has two distinct use cases:
> <ol>
> <li>fetching a value and printing it</li>
> <li>putting a value on the top of the value stack within its body</li>
> </ol>
>
> If the body of the tag is empty (for example <pre><webwork:property
>value="foo"/></pre> or
> <pre><webwork:property value="foo"></webwork:property value="foo"></pre>) it will
>automatically
> use the first use case, i.e. print the value. If the body is not empty (for example
> <pre><webwork:property value="foo">foo</webwork:property value="foo"></pre>) it will
>use the
> second use case. Observe that even one space or newline is counted as "not empty".
>
> By default, it will escape HTML characters for use case 1. Tags with bodies will not
>be
> escaped by default. You can override this with explicit setting of the escape
>attribute.
645c655
< Ascending:<br>
---
> Ascending:<br />
647,649c657,659
< <webwork:iterator>
< <webwork:property/><br>
< </webwork:iterator>
---
> <webwork:iterator>
> <webwork:property/><br />
> </webwork:iterator>
651d660
< <p>
668,670c677,679
< <webwork:iterator>
< <webwork:property/><br>
< </webwork:iterator>
---
> <webwork:iterator>
> <webwork:property/><br>
> </webwork:iterator>
672d680
< <p>
685,687c693,695
< <webwork:iterator>
< <webwork:property/><br>
< </webwork:iterator>
---
> <webwork:iterator>
> <webwork:property/><br>
> </webwork:iterator>
689d696
< <p>
727c734
< <H1>Testing append, subset, and value generators</H1>
---
> <h1>Testing append, subset, and value generators</h1>
730,747c737,755
< <webwork:bean name="'webwork.util.Counter'">
< <webwork:param name="'last'" value="5"/>
< <webwork:iterator id="colcount">
< <tr>
< <iterator:generator val="'foo,bar,xyzzy'" separator="','" count="@colcount"
id="values"/>
< <iterator:generator val="' '" count="-1" id="space"/>
< <iterator:append>
< <webwork:param name="'source'" value="@values"/>
< <webwork:param name="'source'" value="@space"/>
<
< <iterator:subset count="6">
< <webwork:iterator>
< <td width=40><webwork:property/></td>
< </webwork:iterator>
< </iterator:subset>
< </iterator:append>
< </tr>
< </webwork:iterator>
---
> <webwork:bean name="'webwork.util.Counter'">
> <webwork:param name="'last'" value="5"/>
> <webwork:iterator id="colcount">
> <tr>
> <iterator:generator val="'foo,bar,xyzzy'" separator="','" count="@colcount"
>id="values"/>
> <iterator:generator val="' '" count="-1" id="space"/>
> <iterator:append>
> <webwork:param name="'source'" value="@values"/>
> <webwork:param name="'source'" value="@space"/>
>
> <iterator:subset count="6">
> <webwork:iterator>
> <td width="40"><webwork:property/></td>
> </webwork:iterator>
> </iterator:subset>
> </iterator:append>
> </tr>
> </webwork:iterator>
> </webwork:bean>
749d756
< </webwork:bean>
793c800
< <td><b><webwork:text name="'cd.albumLabel'"/></b></td>
---
> <webwork:text name="'cd.albumLabel'"/><br />
817,818c824,826
< <form action="<webwork:url value="'hiturl.action'"/>" method="POST">
< ...
---
> <form action="<webwork:url value="'hiturl.action'"/>" method="POST">
> ...
> </form>
831a840
> </form>
1300,1301c1309,1310
< <webwork:action name="'BookList'" id="booklist"/>
< <ui:select label="'Book'" name="'auth'" list="@booklist/books" listKey="'author'"
listValue="'title'"/>
---
> <webwork:action name="'BookList'" id="booklist"/>
> <ui:select label="'Book'" name="'auth'" list="@booklist/books" listKey="'author'"
>listValue="'title'"/>
1373,1377c1382,1386
< <webwork:param name="'columnHidden(1)'" value="true"/>
< <webwork:param name="'columnDisplayName(2)'" value="'New Display Name'"/>
< <webwork:param name="'columnRenderer(0)'" value="@dateRenderer"/>
< <webwork:param name="'columnRenderer(2)'" value="@linkRenderer"/>
< <webwork:param name="'columnRenderer(4)'" value="@intRenderer"/>
---
> <webwork:param name="'columnHidden(1)'" value="true"/>
> <webwork:param name="'columnDisplayName(2)'" value="'New Display Name'"/>
> <webwork:param name="'columnRenderer(0)'" value="@dateRenderer"/>
> <webwork:param name="'columnRenderer(2)'" value="@linkRenderer"/>
> <webwork:param name="'columnRenderer(4)'" value="@intRenderer"/>
1602,1608c1611,1617
< <form>
< <vui:field name="'foo'">
< <vui:prompt>
< <vui:audio persona="'female'" src="'test.wav'" tts="'This is a test'"/>
< </vui:prompt>
< </vui:field>
< </form>
---
> <form>
> <vui:field name="'foo'">
> <vui:prompt>
> <vui:audio persona="'female'" src="'test.wav'" tts="'This is a test'"/>
> </vui:prompt>
> </vui:field>
> </form>
1663,1669c1672,1678
< <form>
< <vui:field name="'foo'">
< <vui:prompt>
< <vui:audio persona="'female'" src="'test.wav'" tts="'This is a test'"/>
< </vui:prompt>
< </vui:field>
< </form>
---
> <form>
> <vui:field name="'foo'">
> <vui:prompt>
> <vui:audio persona="'female'" src="'test.wav'" tts="'This is a test'"/>
> </vui:prompt>
> </vui:field>
> </form>
1720,1725c1729,1734
< <form>
< <vui:field name="'foo'">
< <prompt>Hello, World</prompt>
< <vui:filled action="'nextform.action'"/>
< </vui:field>
< </form>
---
> <form>
> <vui:field name="'foo'">
> <prompt>Hello, World</prompt>
> <vui:filled action="'nextform.action'"/>
> </vui:field>
> </form>
1780,1784c1789,1793
< <form>
< <vui:field name="'foo'">
< <vui:grammar mode="voice" model="@grammar"/>
< </vui:field>
< </form>
---
> <form>
> <vui:field name="'foo'">
> <vui:grammar mode="voice" model="@grammar"/>
> </vui:field>
> </form>
1827,1831c1836,1840
< <form>
< <vui:field name="'foo'">
< <vui:log>Entering Field foo</vui:log>
< </vui:field>
< </form>
---
> <form>
> <vui:field name="'foo'">
> <vui:log>Entering Field foo</vui:log>
> </vui:field>
> </form>
1886,1892c1895,1901
< <form>
< <vui:field name="'foo'">
< <vui:prompt bargein="'false'">
< <vui:audio src="'welcome.wav'"/>
< </vui:prompt>
< </vui:field>
< </form>
---
> <form>
> <vui:field name="'foo'">
> <vui:prompt bargein="'false'">
> <vui:audio src="'welcome.wav'"/>
> </vui:prompt>
> </vui:field>
> </form>
Index: views-jsp.jsp
===================================================================
RCS file: /cvsroot/opensymphony/webwork/src/docs/manual/views-jsp.jsp,v
retrieving revision 1.2
diff -r1.2 views-jsp.jsp
70a71,72
> <p>A more exchaustive description of the tags can be found in the <a
>href="tag.jsp">appendix on the WW taglib</a>.</p>
>