Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在JspWriter中包含jsp include指令_Jsp - Fatal编程技术网

如何在JspWriter中包含jsp include指令

如何在JspWriter中包含jsp include指令,jsp,Jsp,我有这样的要求 buffer.append("<table width="+tableWidth+" height="+tableHeight+">" + "<tr>" + "<td class="+cssTableBackGround+">" + NBSP2+ "" + "<img id='"+ID+"' border="+0+" src="+imageDown+" name='toggleImage'/> (\"javascript:simpl

我有这样的要求

buffer.append("<table width="+tableWidth+" height="+tableHeight+">" +
"<tr>" +
"<td class="+cssTableBackGround+">" +
NBSP2+
"" +
"<img id='"+ID+"' border="+0+" src="+imageDown+" name='toggleImage'/> (\"javascript:simpleToggle('"+ADVANCED+"',) " +
NBSP2+
"<font class="+cssClass+"> "+
"Edit ChairPerson" +
"</td></tr></table>" +
"<div id='"+ADVANCED+"' style='background-color:#cccccc;display:none; overflow:hidden;height:95px;width:75%'>"+
"<%@ include file=\"advancedEpanded.jsp\" %>" +
"</div>");

JspWriter out = pc.getOut();
out.write(buffer.toString());
buffer.append(“)+
"" +
"" +
NBSP2+
"" +
(\“javascript:simpleToggle(“+ADVANCED+”,)”+
NBSP2+
" "+
“编辑主席”+
"" +
""+
"" +
"");
JspWriter out=pc.getOut();
out.write(buffer.toString());
我需要在代码中包含另一个jsp。 有办法吗?
我也尝试过使用jsp include。但我看不到屏幕上的内容。

最好的解决方案是将所有HTML代码移到jsp文件中,放在它实际所属的位置,然后您就可以将
放在相应的位置

<jsp:include page="foo.jsp" />
request.getRequestDispatcher("foo.jsp").include(request, response);