This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes accessing enclosing jsp's var in included jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "accessing enclosing jsp Watch "accessing enclosing jsp New topic
Author

accessing enclosing jsp's var in included jsp

sunil kumre
Ranch Hand

Joined: Dec 23, 2000
Posts: 64
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

Joined: Jan 30, 2000
Posts: 3222
    
    5
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.


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: accessing enclosing jsp's var in included jsp
 
Similar Threads
include directive
db connection problem
access a parent's form in an iframe
Null Arguement Question
Custom taglib prolem