【Java开源代码栏目提醒】:以下是网学会员为您推荐的Java开源代码-variableTagDemo_tag.java,希望本篇文章对您学习有所帮助。
package org.apache.jsp.tag.
web;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class variableTagDemo_tag
extends javax.servlet.jsp.tagext.SimpleTagSupport
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
private JspContext jspContext;
private java.io.Writer _jspx_sout;
private org.apache.jasper.runtime.TagHandlerPool _jspx_tagPool_c_set_var_value_nobody;
public void setJspContext(JspContext ctx) {
super.setJspContext(ctx);
java.util.ArrayList _jspx_nested = null;
java.util.ArrayList _jspx_at_begin = null;
java.util.ArrayList _jspx_at_end = null;
_jspx_nested = new java.util.ArrayList();
_jspx_nested.add("add");
_jspx_nested.add("sub");
_jspx_nested.add("multiply");
_jspx_nested.add("divide");
this.jspContext = new org.apache.jasper.runtime.JspContextWrapper(ctx, _jspx_nested, _jspx_at_begin, _jspx_at_end, null);
}
public JspContext getJspContext() {
return this.jspContext;
}
private java.lang.String firstNum;
private java.lang.String secondNum;
public java.lang.String getFirstNum() {
return this.firstNum;
}
public void setFirstNum(java.lang.String firstNum) {
this.firstNum = firstNum;
}
public java.lang.String getSecondNum() {
return this.secondNum;
}
public void setSecondNum(java.lang.String secondNum) {
this.secondNum = secondNum;
}
public java.util.List getDependants() {
return _jspx_dependants;
}
private void _jspInit(ServletConfig config) {
_jspx_tagPool_c_set_var_value_nobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(config);
}
public void _jspDestroy() {
_jspx_tagPool_c_set_var_value_nobody.release();
}
public void doTag() throws JspException, java.io.IOException {
PageContext _jspx_page_context = (PageContext)jspContext;
HttpServletRequest request = (HttpServletRequest) _jspx_page_context.getRequest();
HttpServletResponse response = (HttpServletResponse) _jspx_page_context.getResponse();
HttpSession session = _jspx_page_context.getSession();
ServletContext application = _jspx_page_context.getServletContext();
ServletConfig config = _jspx_page_context.getServletConfig();
JspWriter out = jspContext.getOut();
_jspInit(config);
if( getFirstNum() != null )
_jspx_page_context.setAttribute("firstNum", getFirstNum());
if( getSecondNum() != null )
_jspx_page_context.setAttribute("secondNum", getSecondNum());
try {
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
if (_jspx_meth_c_set_0(_jspx_page_context))
return;
out.write('\r');
out.write('\n');
if (_jspx_meth_c_set_1(_jspx_page_context))
return;
out.write('\r');
out.write('\n');
if (_jspx_meth_c_set_2(_jspx_page_context))
return;
out.write('\r');
out.write('\n');
if (_jspx_meth_c_set_3(_jspx_page_context))
return;
out.write("\r\n");
out.write("\r\n");
((org.apache.jasper.runtime.JspContextWrapper) this.jspContext).syncBeforeInvoke();
_jspx_sout = null;
if (getJspBody() != null)
getJspBody().invoke(_jspx_sout);
} catch( Throwable t ) {
if( t instanceof SkipPageException )
throw (SkipPageException) t;
if( t instanceof java.io.IOException )
throw (java.io.IOException) t;
if( t instanceof IllegalStateException )
throw (IllegalStateException) t;
if( t instanceof JspException )
throw (JspException) t;
throw new JspException(t);
} finally {
((org.apache.jasper.runtime.JspContextWrapper) jspContext).syncEndTagFile();
_jspDestroy();
}
}
private boolean _jspx_meth_c_set_0(PageContext _jspx_page_context)
throws Throwable {
JspWriter out = _jspx_page_context.getOut();
// c:set
org.apache.taglibs.standard.tag.rt.core.SetTag _jspx_th_c_set_0 = (org.apache.taglibs.standard.tag.rt.core.SetTag) _jspx_tagPool_c_set_var_value_nobody.get(org.apache.taglibs.standard.tag.rt.core.SetTag.class);
_jspx_th_c_set_0.setPageContext(_jspx_page_context);
_jspx_th_c_set_0.setParent(null);
_jspx_th_c_set_0.setVar("add");
_jspx_th_c_set_0.setValue((java.lang.Object) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${firstNum+secondNum