Hi, we all know that those variables in page scope are sharable in both including and included files using static inclusion. 1) However, how about <jsp:forward> action, I think it is not the case. Owing to the process cycle, we need to use setattribute to pass some variables in <jsp:include> action. 2) if I use pageContext.setAttribute(XXX, page), am I fooling myself. and get a wrong result? 3) Are there any scopes in <jsp:getProperty>? 4) If I take this action <jsp:useBean id="xxx" class="xxx">, and then <jsp:forward page="new.jsp">, can javabean "xxx"'s properties be accessed in new.jsp. Since I only set this bean in page scope. Thx
Dynamic inclusion or forward actions do not have access to page scoped vars of the first 'including' jsp. Meaning,if a.jsp uses <jsp:include ....../> or <jsp:forward ...... /> another b.jsp , then b.jsp can not access a.jsp's page scoped vars like your case. The 'xxx' var is page scoped var and it is invisible in the 'forwarded' jsp. But the implicit 'request' object is same in both pages. So we can do request.setAttribute(name,value) trick to share objects.
Regards, Maha Anna [ November 25, 2002: Message edited by: Maha Annadurai ]
Joined: Oct 27, 2002
Here is the example code I played with.
when you invoke one.jsp , you will get a 500 internal server error like this.