What is the use case where the context can not be found via
WebApplicationContextUtils.getRequiredApplicationContext(aServletContext).?

Juergen

On 9/3/06, Erik Brakkee <[EMAIL PROTECTED]> wrote:
> Hi,
>
>
> I have done some work to locate the Spring application context in
> another way. Both wicket-spring and wicket-spring-annot assume that the
> application context can be obtained with
> WebApplicationContextUtils.getRequiredApplicationContext(aServletContext).
>
> Luckily, it is easy to write my own IWebApplicationFactory which does
> the appropriate lookup and I am still able to extend
> SpringWebApplication. Nevertheless, this does not work because
> SpringComponentInjector also hardcodes a lookup of the application
> context using WebApplicationContextUtils.
>
> The code is like this:
>
> public SpringComponentInjector(WebApplication webapp) {
>                 // locate spring's application context ...
>                 ServletContext sc =
> webapp.getWicketServlet().getServletContext(
> );
>
>                 final ApplicationContext ctx = WebApplicationContextUtils
>                                 .getRequiredWebApplicationContext(sc);
>
>                  ....
> }
>
> In other words, a redundancy. In my opinion, the code should be modified
> as follows:
>
> 1. Add a new constructor which accepts the ApplicationContext as a
> parameter.
> 2. Remove the existing constructor with the WebApplication OR document
> it to use the WebApplicationContextUtils
>    for retrieving the application context
>
> What do you think?
>
> Cheers
>   Erik
>
>
>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to