File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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