Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

accessing enclosing jsp's var in included jsp

 
sunil kumre
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm invoking a jsp inside of this i'm including another jsp at runtime using jsp:include.
Can someone tell how to access a java variable from the enclosing jsp inside this included jsp.
thanks in advance
sunil
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By placing the variable in the request object via
request.setAttribute()
and then retreiving it with request.getAttibute() in the other JSP.
This is for dynamic includes, BTW, not for static ones.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic