Gareth Western wrote:

Hi,
Can someone fill me in as to what I need to do to make objects that are instanstiated in one servlet available to another servlet? I tried using getServletContext().setAttribute("some.name", myObj) however I was unable to retrieve the object in the other servlet.
I notice there are some 'public' ServletContext attributes such as


org.apache.catalina.jsp_classpath
javax.servlet.context.tempdir
org.apache.catalina.resources
org.apache.catalina.WELCOME_FILES

So where/how does Tomcat define these?

If you wish to share things, runtime, you should use one of defined contexts:


- page context
- request context
- session context
- application context

If servlets are in the same request chain, you can use request context. If they are in the same session instance, you can use session context. Or you can use application context.

Nix.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to