I want to put a variable in the requestScope
so I can use it in an other page. Unfortunately, the requestScope
is totally empty in this other page. In fact, when I print #{requestScope}
in both pages, they don't have the same memory adresse !
mainPage.jsp
<c:set var="foo" value="${myForm.myJavaObject}" scope="request" />
<c:forEach var="scope" items="${requestScope}">
${scope.key} // PRINTS EVERY VARIABLE IN THE REQUEST SCOPE, INCLUDING foo
</c:forEach>
<jsp:include page="./includedPage.jsp"/>
includedPage.jsp
<c:forEach var="scope" items="${requestScope}">
${scope.key} // PRINTS NOTHING
</c:forEach>
Same thing if try different scopes (session, application etc.). I don't get it. This method is all over the internet, so why is it not working? First time I use it.