retrieving bean from webapplicationcontext?
Scott Battaglia
scott.battaglia at gmail.com
Fri Sep 1 08:14:48 EDT 2006
Yes, it should be perfectly safe to move it out of there into the
applicationContext.xml.
-Scott
On 9/1/06, Kris Melotte <kris.melotte at expandedmedia.com> wrote:
>
> Scott,
>
>
>
> This does not work either.
>
> I receive java.lang.IllegalStateException: No WebApplicationContext found:
> not in a DispatcherServlet request?
>
>
>
> I think this is because we are not into the processing if the
> DispatcherServlet . This is only after the filter executes.
>
>
>
> Do you think it is safe to move the ticketGrantingTicketCookieGenerator
> out of cas-servlet.xml to the applicationContext.xml?
>
> This way it works fine via
> WebApplicationContextUtils.getRequiredWebApplicationContext().
>
>
>
> Thanks,
>
> Kris
>
>
> ------------------------------
>
> *From:* cas-bounces at tp.its.yale.edu [mailto:cas-bounces at tp.its.yale.edu] *On
> Behalf Of *Scott Battaglia
> *Sent:* Thursday, August 31, 2006 5:15 PM
> *To:* Yale CAS mailing list
> *Subject:* Re: retrieving bean from webapplicationcontext?
>
>
>
> Kris,
>
> The first thing I would try is not using the SafeDispatcherServlet. Its
> not required and it only puts up a nice failure message (I actually remove
> it for Rutgers deployments because it was just an extra layer that provided
> us no benefit in production [or even in test really]).
>
> -Scott
>
> On 8/31/06, *Kris Melotte* <kris.melotte at expandedmedia.com> wrote:
>
> Hello,
>
>
>
> I want to add a custom servlet filter to my cas server.
>
> In that filter I want to retrieve the bean
> "ticketGrantingTicketCookieGenerator" which is defined in cas-servlet.xml.
>
>
>
> The bean can not be found via
> WebApplicationContextUtils.getRequiredWebApplicationContext(
> session.getServletContext ()), probably because spring only looks in
> applicationContext.xml.
>
>
>
> Via RequestContextUtils.getWebApplicationContext(request).getBean("ticketGrantingTicketCookieGenerator",
> CookieGenerator.class) I receive an error that the request isn't
> associated with springs DispatcherServlet. This is probably because the
> SafeDispatcherServlet proxies for the DispatcherServlet.
>
>
>
> Is there a way how I can get access to this bean from my filter?
>
>
>
> Regards,
>
> Kris
>
>
> _______________________________________________
> Yale CAS mailing list
> cas at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas
>
>
>
> _______________________________________________
> Yale CAS mailing list
> cas at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tp.its.yale.edu/pipermail/cas/attachments/20060901/62732735/attachment.html
More information about the cas
mailing list