📄 inputtag.java
字号:
/* * Copyright 2004 original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package org.extremecomponents.table.tag;import javax.servlet.jsp.JspException;import javax.servlet.jsp.tagext.TagSupport;import org.extremecomponents.table.bean.Attributes;import org.extremecomponents.table.bean.Input;/** * @jsp.tag name="input" display-name="InputTag" body-content="JSP" * description="Put hidden field, submit or button in the form." * * @author jeff johnston */public class InputTag extends TagSupport implements ExtendedAttributes { private String type; private String name; private String value; private String onclick; /** * @jsp.attribute description="The type of html input to create. The valid * types are hidden, button, and submit." required="true" * rtexprvalue="true" */ public String getType() { return TagUtils.evaluateExpressionAsString("type", type, this, pageContext); } public void setType(String type) { this.type = type; } /** * @jsp.attribute description="The name of the field." required="true" * rtexprvalue="true" */ public String getName() { return TagUtils.evaluateExpressionAsString("name", name, this, pageContext); } public void setName(String name) { this.name = name; } /** * @jsp.attribute description="The value of the field." required="true" * rtexprvalue="true" */ public String getValue() { return TagUtils.evaluateExpressionAsString("value", value, this, pageContext); } public void setValue(String value) { this.value = value; } /** * @jsp.attribute description="The javascript to invoke when clicking on a * submit or button." required="false" rtexprvalue="true" */ public String getOnclick() { return TagUtils.evaluateExpressionAsString("onclick", onclick, this, pageContext); } public void setOnclick(String onclick) { this.onclick = onclick; } public int doEndTag() throws JspException { Input input = new Input(); input.addAttribute(Input.TYPE, getType()); input.addAttribute(Input.NAME, getName()); input.addAttribute(Input.VALUE, getValue()); input.addAttribute(Input.ONCLICK, getOnclick()); addExtendedAttributes(input); TagUtils.getModel(this).getFormHandler().addInput(input); return EVAL_PAGE; } public void addExtendedAttributes(Attributes attributes) throws JspException { } public void release() { type = null; name = null; value = null; onclick = null; super.release(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -