hi Joe,
Implementing the ResourceLoaderAware interface has solved my problem.
many thanks!
i havent tried to use ServletContextAware but I think it will work
equally well.
many thanks
Jeff
On 31 Jan 2007, at 16:38, Joe Germuska wrote:
Jeff:
I think there are a lot of possible routes,
On 1/31/07, Tom Schneider <[EMAIL PROTECTED]> wrote:
It would be very easy to create a Spring FactoryBean for this.
In this case, couldn't one simply implement Spring's ServletContextAware
interface?
http://www.springframework.org/docs/api/org/springframework/web/context/ServletContextAware.
Jeff:
I think there are a lot of possible routes, but I'm not sure I understand
your goal.
Could you just have your service implement ResourceLoaderAware? If your
Spring ApplicationContext is a WebApplicationContext (as it would be if set
up by ContextLoaderListener), then the ResourceLoader wo
Hi Tom,
I have tried your suggestion, my applicationContex.xml is now defined
as,
method="getServletContext"/>
class="org.springframework.web.context.support.ServletContextResource">
It would be very easy to create a Spring FactoryBean for this.
(Checkout the Spring Documentation if that doesn't make sense) Then, to
access the servlet context, just do a:
ServletContext servletContext = ServletActionContext.getServletContext();
The FactoryBean would allow you to use depen
Hi Joe,
Thanks for the helpful information. I am just wondering is it
possible to get the ServletContext object in my spring
applicationContext.xml? What i am trying to do now is to create a
Resource object (ServletContextResource) and inject into a service
class and then use this service
You need to make sure that your action is passing through an
interceptor-stack that includes ServletConfigInterceptor
http://struts.apache.org/2.x/core/apidocs/org/apache/struts2/interceptor/ServletConfigInterceptor.html
The struts-default package does include this.
http://struts.apache.org/2.
were u actually able to get the servletContext Object thru
servletContextAware?? I'd tried it but couldn't get it :(
do we need to do any additional stuff for that??
- Original Message -
From: "Jeffrey Hau" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List"
Sent: Wednesday, January 3
8 matches
Mail list logo