001: /*
002: * $Id: FormTag.java 474191 2006-11-13 08:30:40Z mrdon $
003: *
004: * Licensed to the Apache Software Foundation (ASF) under one
005: * or more contributor license agreements. See the NOTICE file
006: * distributed with this work for additional information
007: * regarding copyright ownership. The ASF licenses this file
008: * to you under the Apache License, Version 2.0 (the
009: * "License"); you may not use this file except in compliance
010: * with the License. You may obtain a copy of the License at
011: *
012: * http://www.apache.org/licenses/LICENSE-2.0
013: *
014: * Unless required by applicable law or agreed to in writing,
015: * software distributed under the License is distributed on an
016: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017: * KIND, either express or implied. See the License for the
018: * specific language governing permissions and limitations
019: * under the License.
020: */
021: package org.apache.struts2.views.jsp.ui;
022:
023: import javax.servlet.http.HttpServletRequest;
024: import javax.servlet.http.HttpServletResponse;
025:
026: import org.apache.struts2.components.Component;
027: import org.apache.struts2.components.Form;
028: import org.apache.struts2.dispatcher.mapper.ActionMapper;
029:
030: import com.opensymphony.xwork2.inject.Inject;
031: import com.opensymphony.xwork2.util.ValueStack;
032:
033: /**
034: * @see Form
035: */
036: public class FormTag extends AbstractClosingTag {
037:
038: private static final long serialVersionUID = 2792301046860819658L;
039:
040: protected String action;
041: protected String target;
042: protected String enctype;
043: protected String method;
044: protected String namespace;
045: protected String validate;
046: protected String onsubmit;
047: protected String portletMode;
048: protected String windowState;
049: protected String acceptcharset;
050:
051: public Component getBean(ValueStack stack, HttpServletRequest req,
052: HttpServletResponse res) {
053: return new Form(stack, req, res);
054: }
055:
056: protected void populateParams() {
057: super .populateParams();
058: Form form = ((Form) component);
059: form.setAction(action);
060: form.setTarget(target);
061: form.setEnctype(enctype);
062: form.setMethod(method);
063: form.setNamespace(namespace);
064: form.setValidate(validate);
065: form.setOnsubmit(onsubmit);
066: form.setPortletMode(portletMode);
067: form.setWindowState(windowState);
068: form.setAcceptcharset(acceptcharset);
069: }
070:
071: public void setAction(String action) {
072: this .action = action;
073: }
074:
075: public void setTarget(String target) {
076: this .target = target;
077: }
078:
079: public void setEnctype(String enctype) {
080: this .enctype = enctype;
081: }
082:
083: public void setMethod(String method) {
084: this .method = method;
085: }
086:
087: public void setNamespace(String namespace) {
088: this .namespace = namespace;
089: }
090:
091: public void setValidate(String validate) {
092: this .validate = validate;
093: }
094:
095: public void setOnsubmit(String onsubmit) {
096: this .onsubmit = onsubmit;
097: }
098:
099: public void setPortletMode(String portletMode) {
100: this .portletMode = portletMode;
101: }
102:
103: public void setWindowState(String windowState) {
104: this .windowState = windowState;
105: }
106:
107: public void setAcceptcharset(String acceptcharset) {
108: this.acceptcharset = acceptcharset;
109: }
110: }
|