Jsp tag file例子以及说明(13)
来源:未知 责任编辑:责任编辑 发表时间:2015-03-01 01:35 点击:次
// easy:invokeDemo
org.apache.jsp.tag.web.invokeDemo_tag _jspx_th_easy_005finvokeDemo_005f0 = (new org.apache.jsp.tag.web.invokeDemo_tag());
_jsp_instancemanager.newInstance(_jspx_th_easy_005finvokeDemo_005f0);
_jspx_th_easy_005finvokeDemo_005f0.setJspContext(_jspx_page_context);
javax.servlet.jsp.tagext.JspFragment _jspx_temp0 = new Helper( 0, _jspx_page_context, _jspx_th_easy_005finvokeDemo_005f0, null);// 构造JspFragment类,设置到tag类中,供tag类invoke回调
// /invokeTest.jsp(7,0) null
_jspx_th_easy_005finvokeDemo_005f0.setProductDetails(_jspx_temp0);
_jspx_th_easy_005finvokeDemo_005f0.doTag();
_jsp_instancemanager.destroyInstance(_jspx_th_easy_005finvokeDemo_005f0);
out.write("\r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
//在jsp类中定义JspFragment类
private class Helper
extends org.apache.jasper.runtime.JspFragmentHelper
{
private javax.servlet.jsp.tagext.JspTag _jspx_parent;
private int[] _jspx_push_body_count;
public Helper( int discriminator, javax.servlet.jsp.JspContext jspContext, javax.servlet.jsp.tagext.JspTag _jspx_parent, int[] _jspx_push_body_count ) {
super( discriminator, jspContext, _jspx_parent );
this._jspx_parent = _jspx_parent;
this._jspx_push_body_count = _jspx_push_body_count;
}
public void invoke0( javax.servlet.jsp.JspWriter out )
throws java.lang.Throwable
{
out.write("<table width=\"220\" border=\"1\">\r\n");
out.write(" <tr>\r\n");
out.write(" <td><b>Product Name</b></td>\r\n");
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>