• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

transfer object between scriplet and jstl

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to transfer object between scriplet and jstl(1.1) ?

For example:
<%
Integer a = 1;
pageContext.setAttribute("a",a,pageContext.PAGE_SCOPE);
%>
<c:if test='${pageContext.a > 0}'>
...
</c:if>
-- the error message is , pageContext.a is not existed.

Why? Thanks.
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got the answer.

We need to use pageScope instead of pageContext.

Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic