View Javadoc

1   /*
2    * This file was automatically generated by Apache Tiles Autotag.
3    */
4   package org.apache.tiles.jsp.taglib;
5   
6   import java.io.IOException;
7   
8   import javax.servlet.jsp.JspException;
9   import javax.servlet.jsp.tagext.SimpleTagSupport;
10  
11  import org.apache.tiles.autotag.core.runtime.ModelBody;
12  import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
13  
14  /**
15   * <p>
16   * <strong>Declare a list that will be pass as an attribute. </strong>
17   * </p>
18   * <p>
19   * Declare a list that will be pass as an attribute . List elements are added
20   * using the tag 'addAttribute' or 'addListAttribute'. This tag can only be used
21   * inside 'insertTemplate', 'insertDefinition' or 'definition' tag.
22   * </p>
23   */
24  public class AddListAttributeTag extends SimpleTagSupport {
25  
26      /**
27       * The template model.
28       */
29      private org.apache.tiles.template.AddListAttributeModel model = new org.apache.tiles.template.AddListAttributeModel();
30  
31      /**
32       * The comma-separated list of roles that can use the list attribute.
33       */
34      private java.lang.String role;
35  
36      /**
37       * Getter for role property.
38       *
39       * @return
40       * The comma-separated list of roles that can use the list attribute.
41       */
42      public java.lang.String getRole() {
43          return role;
44      }
45  
46      /**
47       * Setter for role property.
48       *
49       * @param role
50       * The comma-separated list of roles that can use the list attribute.
51       */
52      public void setRole(java.lang.String role) {
53          this.role = role;
54      }
55  
56      /** {@inheritDoc} */
57      @Override
58      public void doTag() throws JspException, IOException {
59          AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
60          if (runtime instanceof SimpleTagSupport) {
61              SimpleTagSupport tag = (SimpleTagSupport) runtime;
62              tag.setJspContext(getJspContext());
63              tag.setJspBody(getJspBody());
64              tag.setParent(getParent());
65              tag.doTag();
66          }
67          org.apache.tiles.request.Request request = runtime.createRequest();        
68          ModelBody modelBody = runtime.createModelBody();
69          model.execute(
70              role,
71              request, modelBody
72          );
73      }
74  }