开发者

How to include jsp include directive in JspWriter

开发者 https://www.devze.com 2023-01-17 07:10 出处:网络
I have my r开发者_StackOverflow中文版equirement like this buffer.append(\"<table width=\"+tableWidth+\" height=\"+tableHeight+\">\" +

I have my r开发者_StackOverflow中文版equirement like this

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());

i need to include another jsp in the code. is there a way to do it? i tried with jsp include also. but i canot see the content ont the screen.


Best solution would be to move all that HTML code out into a JSP file, there where it actually belongs, then you'll be able to put a <jsp:include> somewhere along the lines.

<jsp:include page="foo.jsp" />

If you really insist in keep doing this the ugly way, then use RequestDispatcher#include().

request.getRequestDispatcher("foo.jsp").include(request, response);
0

精彩评论

暂无评论...
验证码 换一张
取 消