posted 20 years ago
Hi,
I have three JSPs, they are a.jsp, b.jsp and test.jsp.
Can you tell me why the following codes run to a different result?
Please pay attention to the line "AAAAAAAAAAAAAAAA"
and the line "this is bbbbbbbbbbbbbb.jsp" in the results.
/////////////////////////////////////////a.jsp:
<br>this is aaaaaaaaaaaa.jsp
/////////////////////////////////////////b.jsp:
<br>this is bbbbbbbbbbbbbb.jsp
/////////////////////////////////////////test.jsp:
<html><body>
<br>AAAAAAAAAAAAAAAA
<%pageContext.include("a.jsp");%> <%//pageContext line%>
<br>BBBBBBBBBBBBBBBB
<%request.getRequestDispatcher("b.jsp").include(request, response);%>
</body></html>
the output in the IE browser:
AAAAAAAAAAAAAAAA
this is bbbbbbbbbbbbbb.jsp
this is aaaaaaaaaaaa.jsp
BBBBBBBBBBBBBBBB
/////////////////////////////////////////test.jsp
//(with the line
//< %pageContext.include("a.jsp");% > < %//pageContext line% >
//deleted):
<html><body>
<br>AAAAAAAAAAAAAAAA
<br>BBBBBBBBBBBBBBBB
<%request.getRequestDispatcher("b.jsp").include(request, response);%>
<br>CCCCCCCCCCCCCCCC
</body></html>
the output in the IE browser:
this is bbbbbbbbbbbbbb.jsp
AAAAAAAAAAAAAAAA
BBBBBBBBBBBBBBBB
thanks!
----------------------------------<br />SCJP SCWCD<br />dive into EJB, drinking hot Java