Hi

  The HttpSession does not have a servletcontext, the servlet has, and you
can get to the servlet from the ActionForm with the getServlet() method.

So
    Object o =
         getServlet().getServletContext().getAttribute("attribute_name");

should work
  (has not tried it "live" though :-) )


  Regards
  Mikael


At 14:24 2002-03-06 -0700, you wrote:
>Hello,
>
>I was searching around in the struts-user list archives for the correct
>getServletContext() syntax and found Robert's response to a post:
>http://www.mail-archive.com/[email protected]/msg22768.html
>
>I am trying to compile an ActionForm and I need to access the *application*
>scoped bean (not a session bean).
>
>I tried:
>
>public ActionErrors validate(ActionMapping mapping, HttpServletRequest
>request)
>{
>         ....
>         Object o =
>request.getSession().getServletContext().getAttribute("attribute_name");
>
>}



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

Reply via email to