Please make sure you have read the Tag Syntax document and understand how tag attribute syntax works.
The id
attribute is deprecated in Struts 2.1.x, and has been replaced by the var
attribute.
The begin
, end
and step
attributes are only available from 2.1.7 on
Description
Error formatting macro: snippet: java.lang.NullPointerException
Parameters
Error formatting macro: snippet: java.lang.NullPointerException
Examples
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
Error formatting macro: snippet: java.lang.NullPointerException
5 Comments
Jan Normann Nielsen
Change "java.util.Collection, java.util.Iterator," to "java.util.Collection, java.util.Iterator, java.util.Enumeration, java.util.Map, array."
Change "instanceof" to "instance of".
Change "else an the object" to "else the object".
Change "and then calls its" to "and the call its".
Change "used to create a IteratorStatus object" to "used to create an IteratorStatus object".
Change "seperate" to "separate".
Change ">s:property />" to "<s:property />".
Add missing "</s:action>" to second-to-last code sample.
In the last code sample, there are five elements in the iterator, therefore there must be five indexes, either 0-4 or 1-5. In other words, change the line:
<!-- current iteration value (0, 1, ... 5) -->
Dave Newton
The items that needed correcting have been corrected ("the call its", "missing </s:action" not errors).
Lukasz Lenart
Description of attribute id should be marked with Struts version, deprecated since Struts 2.1.x, it is a common mistake for new Struts developers
Philip Luppens
Indeed. Since I don't have access to the source repository atm, I've added a note on tope of the page. Thanks for the heads up.
Patrick Mohr
The section where the action and iterator tag are together is very hard to read. Mostly because there are three different things called "entries". It also doesn't help that there's no java code to go with the example. I admit that I'm a Struts2 newbie, but it took me about 20-30 minutes of trial and error to get it working.
<s:action name="entries" var="entries"/>
<s:iterator value="#entries.entries" >...