File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "accessing enclosing jsp Watch "accessing enclosing jsp New topic

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
Tony Alicea

Joined: Jan 30, 2000
Posts: 3226
By placing the variable in the request object via
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
I agree. Here's the link:
subject: accessing enclosing jsp's var in included jsp
It's not a secret anymore!