View Javadoc

1   /*
2    * $Id: HeadTag.java 651946 2008-04-27 13:41:38Z apetrelli $
3    *
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *  http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  package org.apache.struts2.dojo.views.jsp.ui;
23  
24  import javax.servlet.http.HttpServletRequest;
25  import javax.servlet.http.HttpServletResponse;
26  
27  import org.apache.struts2.components.Component;
28  import org.apache.struts2.dojo.components.Head;
29  import org.apache.struts2.views.jsp.ui.AbstractUITag;
30  
31  import com.opensymphony.xwork2.util.ValueStack;
32  
33  /***
34   * @see Head
35   */
36  public class HeadTag extends AbstractUITag {
37  
38      private static final long serialVersionUID = 6876765769175246030L;
39  
40      private String debug;
41      private String compressed;
42      private String baseRelativePath;
43      private String extraLocales;
44      private String locale;
45      private String cache;
46      private String parseContent;
47      
48      public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
49          return new Head(stack, req, res);
50      }
51  
52      protected void populateParams() {
53          super.populateParams();
54          
55          Head head = (Head) component;
56          head.setDebug(debug);
57          head.setCompressed(compressed);
58          head.setBaseRelativePath(baseRelativePath);
59          head.setExtraLocales(extraLocales);
60          head.setLocale(locale);
61          head.setCache(cache);
62          head.setParseContent(parseContent);
63      }
64  
65      public void setDebug(String debug) {
66          this.debug = debug;
67      }
68  
69      public void setBaseRelativePath(String baseRelativePath) {
70          this.baseRelativePath = baseRelativePath;
71      }
72  
73      public void setCompressed(String compressed) {
74          this.compressed = compressed;
75      }
76  
77      public void setExtraLocales(String extraLocales) {
78          this.extraLocales = extraLocales;
79      }
80  
81      public void setLocale(String locale) {
82          this.locale = locale;
83      }
84  
85      public void setCache(String cache) {
86          this.cache = cache;
87      }
88  
89      public void setParseContent(String parseContent) {
90          this.parseContent = parseContent;
91      }
92  }