You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Bookmarkable link

Table of contents

Notes on using Wicket with Websphere

WicketServlet rather than WicketFilter

Sometimes, you need to use WicketServlet rather than WicketFilter in your web.xml because Spring's ContextLoaderListener doesn't work in WAS 5.

The workaround is nominally to use ContextLoaderServlet, but if you then use a filter such as WicketFilter, it gets loaded before ContextLoaderServlet, which results in an exception from Spring.

Most likely this the configuration you would use under such condition

<context-param>
  	<param-name>contextConfigLocation</param-name>
  	<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param> 
<servlet>
	<servlet-name>context</servlet-name>
	<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
	<load-on-startup>0</load-on-startup>
</servlet>  
<servlet>
	<servlet-name>wicket.wicket</servlet-name>
	<servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-class>
	<init-param>
		<param-name>applicationClassName</param-name>
		<param-value>com.mycompany.WicketApplication</param-value>
	</init-param>
	<init-param>
		<param-name>applicationFactoryClassName</param-name>
		<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
	</init-param>
	<load-on-startup>1</load-on-startup>
</servlet>  
<servlet-mapping>
	<servlet-name>wicket.wicket</servlet-name>
	<url-pattern>/app/*</url-pattern>
</servlet-mapping> 
  • No labels