Hi, I'm new on JSP and Servlet. One servlet generated an object and put it in ServletContext by : getServletContext().getAttribute("examples.myObject"); Now a JSP wants to access this object(reference) and get some internal data of this object. How do I implement this? Thanks for your kind help. Jimmy ------------------ Jimmy
Hi, If you use the servlet context to store state (data) in a servlet, you can use the "application" variable in JSP to access it, provided the servlet and the JSP are in the same Context, i.e. are on the same server running in the same webserver and same JVM. Another way of doing this would be to use the "session" attribute of the JSP page, if your data is valid for a client session. In Servlet: session.putValue("..", "..); In JSP: session.getValue("..."); Hope this helps. Ashwin.
Joined: Feb 05, 2001
Ashwin, Thanks a lot. I will try it. ------------------ Jimmy