I have no experience with two WicketApplications. I am not sure if
this is a good idea.
But besides that: I think you need to tell the bApplication it should
use the org.apache.wicket.spring.SpringWebApplicationFactory, the same
way you did with the WicketApplication servlet. Since the bApplication
servlet creates the cn.meadlai.cms.view.wicket.bApplication you'll get
a different non spring managerd instance.
On Fri, Mar 7, 2008 at 10:49 AM, Mead <[EMAIL PROTECTED]> wrote:
> Hello lars vonk,
>
> I find I have two WebApplication: aWebApplication, bWebApplication
> and aWebApplication inject the spring context(in the web.xml),
> and b havenot inject. but
>
> bWebApplication extends aWebApplication{}
>
> in bWebApplication I call the method following:
> aWebApplication app = (bWebApplication) RequestCycle.get().getApplication();
> app.getFacade();// it's NULL
>
> I think the mostly reason is that!
> How to config two Application with spring inject?
> thinks.
>
>
>
>
>
> <context-param>
> <param-name>applicationBean</param-name>
> <param-value>wicketApplication</param-value>
> </context-param>
> <context-param>
> <param-name>contextConfigLocation</param-name>
> <param-value>
>
> /WEB-INF/applicationContext.xml,/WEB-INF/cms-Context.xml,
> </param-value>
> </context-param>
>
> <listener>
>
> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
> </listener>
>
> <!--It is the APP inject the spring context--->
>
> <servlet>
> <servlet-name>WicketApplication</servlet-name>
> <servlet-class>
> org.apache.wicket.protocol.http.WicketServlet
> </servlet-class>
> <init-param>
> <param-name>applicationFactoryClassName</param-name>
>
> <param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
> </init-param>
> <load-on-startup>0</load-on-startup>
> </servlet>
>
>
> <!-- View Application here, It not inject spring, but extends -->
> <servlet>
> <servlet-name>bApplication</servlet-name>
>
> <servlet-class>
> org.apache.wicket.protocol.http.WicketServlet
> </servlet-class>
> <init-param>
> <param-name>applicationClassName</param-name>
>
> <param-value>cn.meadlai.cms.view.wicket.bApplication</param-value>
>
> </init-param>
> <load-on-startup>0</load-on-startup>
> </servlet>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]