View Javadoc

1   /*
2    * $Id: SubmitTag.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.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.components.Submit;
29  
30  import com.opensymphony.xwork2.util.ValueStack;
31  
32  /***
33   * @see Submit
34   */
35  public class SubmitTag extends AbstractUITag {
36  
37      private static final long serialVersionUID = 2179281109958301343L;
38  
39      protected String action;
40      protected String method;
41      protected String align;
42      protected String type;
43      protected String src;
44  
45      public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
46          return new Submit(stack, req, res);
47      }
48  
49      protected void populateParams() {
50          super.populateParams();
51  
52          Submit submit = ((Submit) component);
53          submit.setAction(action);
54          submit.setMethod(method);
55          submit.setAlign(align);
56          submit.setType(type);
57          submit.setSrc(src);
58      }
59  
60      public void setAction(String action) {
61          this.action = action;
62      }
63  
64      public void setMethod(String method) {
65          this.method = method;
66      }
67  
68      public void setAlign(String align) {
69          this.align = align;
70      }
71  
72      public String getType() {
73          return type;
74      }
75  
76      public void setType(String type) {
77          this.type = type;
78      }
79  
80      public void setSrc(String src) {
81          this.src = src;
82      }
83  }