ok - I call a static method with the signature: "public static test(HttpServletRequest req)" How can I access the servletcontext within this method??? I think this MUST be possible, because the HttpServletRequest-object has the getContextPath()-method - so it knows the right context!!!! if this is not possible: which object-reference do I have to give to my static-method??? thank you very much michi > >Michael, > >Request attributes and Context attributes are two separate things. >You should not expect to store an item in one and retrieve it from >the other. The servlet context can be gotten be calling getServletContext() >from within a servlet. > >Ulf > >-----Original Message----- >From: Michael [mailto:[EMAIL PROTECTED]] >Sent: Wednesday, November 21, 2001 11:34 AM >To: [EMAIL PROTECTED] >Subject: ServletContext - PLS HELP!! > > > >Hi! > > >Can you help me, in what I'm doing wrong? > > >I set an attribute in the servletcontext:in the initmethod! >i can access the object using: >config.getServletContext().getAttribute("test") >but not >request.getAttribute("test") >WHY??? > > >how to access this attribute if I only know the HttpServletRequest-object >but not the HttpServlet-object, though I know the contextpath >(request.getContextPath())??? > >thanks >michi
-- To unsubscribe: <mailto:[EMAIL PROTECTED]> For additional commands: <mailto:[EMAIL PROTECTED]> Troubles with the list: <mailto:[EMAIL PROTECTED]>