Consider the following code:
main
JSP:
<jsp: include page="/jsp/includeTest.jsp">
<jsp: param name="test" value="ABC" />
</jsp: include>
in main page: ${ param.test }
/jsp/includeTest.jsp:
in included page: ${ param.test }
<jsp: include page="/jsp/includeTest2.jsp"/>
/jsp/includeTest2.jsp:
in second included page: ${ param.test }
This will output
in included page: ABC
in second included page: ABC
in main page: There's something not clear about this, or even incorrect, in HFSJ. The Book says that the <jsp: param> will create a request parameter, that is visible for all the components in the webapp
that is part of the request. But as the above code shows, it is only available for the duration of the include/forward.
Credits go to Charles Lyon, as I got the concept from his Garner Press mock exam. (Code is not copied from it literally.)
[ August 18, 2008: Message edited by: Jan Sterk ]