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.AutotagRuntime;
12  
13  /**
14   * Selects a container to be used as the "current" container.
15   */
16  public class SetCurrentContainerTag extends SimpleTagSupport {
17  
18      /**
19       * The template model.
20       */
21      private org.apache.tiles.template.SetCurrentContainerModel model = new org.apache.tiles.template.SetCurrentContainerModel();
22  
23      /**
24       * The key of the container to be used as "current". If
25       * <code>null</code>, the default one will be used.
26       */
27      private java.lang.String containerKey;
28  
29      /**
30       * Getter for containerKey property.
31       *
32       * @return
33       * The key of the container to be used as "current". If
34       * <code>null</code>, the default one will be used.
35       */
36      public java.lang.String getContainerKey() {
37          return containerKey;
38      }
39  
40      /**
41       * Setter for containerKey property.
42       *
43       * @param containerKey
44       * The key of the container to be used as "current". If
45       * <code>null</code>, the default one will be used.
46       */
47      public void setContainerKey(java.lang.String containerKey) {
48          this.containerKey = containerKey;
49      }
50  
51      /** {@inheritDoc} */
52      @Override
53      public void doTag() throws JspException, IOException {
54          AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
55          if (runtime instanceof SimpleTagSupport) {
56              SimpleTagSupport tag = (SimpleTagSupport) runtime;
57              tag.setJspContext(getJspContext());
58              tag.setJspBody(getJspBody());
59              tag.setParent(getParent());
60              tag.doTag();
61          }
62          org.apache.tiles.request.Request request = runtime.createRequest();        
63          model.execute(
64              containerKey,
65              request
66          );
67      }
68  }