did you inject the CmsFacade in you MyApplication in your spring config?

Lars

On Fri, Mar 7, 2008 at 9:19 AM, Mead <[EMAIL PROTECTED]> wrote:
> Hello lars vonk,
>  following is a segment of web.xml
>         <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>
>         <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>
>
>  
> ==========================================================================================
>  here is the Panel
>  public class TopBar extends Panel {
>         public TopBar(String id, Model model,CmsFacade facade) {
>                 super(id, model);
>                 MyApplication app = (MyApplication) 
> RequestCycle.get().getApplication();
>                 app.getFacade();
>                 app.getFacade().getSomeBS();//it will cause error
>
>  
> ==========================================================================================
>   this is Application
>  public class MyApplication extends WebApplication {
>         private CmsFacade facade;
>         public CmsFacade getFacade() {
>                 return facade;
>         }
>         public void setFacade(CmsFacade facade) {
>                 this.facade = facade;
>         }
>         public MyApplication() {
>
>     }
>         public Class getHomePage() {
>                 return Home.class;
>         }
>
>  
> ===========================================================================================
>  upstair is my code, thanks
>
>  Best regards,
>
>  ======= At 2008-03-07, 16:08:15 you wrote: =======
>
>
>
>  >Could you post the code of the panel and the stacktrace of the nullpointer?
>  >
>  >On Fri, Mar 7, 2008 at 8:55 AM, Mead <[EMAIL PROTECTED]> wrote:
>  >>
>  >>  well, a Panel Component could not get spring context beans, it got 
> java.lang.NullPointerException, but a WebPage Component is ok.
>  >>   I use 
> 'applicationFactoryClassName=org.apache.wicket.spring.SpringWebApplicationFactory'
>  to config in the web.xml
>  >>
>  >>
>  >>
>  >>
>  >>  ---------------------------------------------------------------------
>  >>  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]
>  >
>
>  = = = = = = = = = = = = = = = = = = = =
>
>  Mead
>  [EMAIL PROTECTED]
>  2008-03-07
>
>
>
>
>
>
>  ---------------------------------------------------------------------
>  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]

Reply via email to