Rev 958 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
958 | dev | 1 | /** |
2 | * Extends and based on Apache Struts source code. |
||
3 | * |
||
4 | * Copyleft Anatoli Klassen (anatoli@aksoft.net) |
||
5 | */ |
||
6 | package ak.strutsx.taglib; |
||
7 | |||
8 | import javax.servlet.jsp.JspException; |
||
9 | |||
10 | import org.apache.struts.action.ActionErrors; |
||
11 | import org.apache.struts.taglib.html.ErrorsTag; |
||
12 | import org.apache.struts.util.RequestUtils; |
||
13 | |||
14 | public class ErrorsIteratorTag |
||
15 | extends ErrorsTag |
||
16 | { |
||
17 | protected String id = null; |
||
18 | |||
19 | public String getId() |
||
20 | { |
||
21 | return this.id; |
||
22 | } |
||
23 | |||
24 | public void setId(String id) |
||
25 | { |
||
26 | this.id = id; |
||
27 | } |
||
28 | |||
29 | public int doStartTag() |
||
30 | throws JspException |
||
31 | { |
||
32 | ActionErrors errors = RequestUtils.getActionErrors(pageContext, name); |
||
33 | |||
34 | if(errors != null) |
||
35 | pageContext.setAttribute(id, (property == null) ? errors.get() : errors.get(property)); |
||
36 | |||
37 | return EVAL_BODY_INCLUDE; |
||
38 | } |
||
39 | |||
40 | public void release() |
||
41 | { |
||
42 | super.release(); |
||
43 | |||
44 | id = null; |
||
45 | } |
||
46 | } |