Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Bookmarkable link

Excerpt
hiddentrue

Notes on using Wicket with Websphere

Panel
borderStylesolid
titleTable of contents
Table of Contents
minLevel2

Notes on using Wicket with Websphere

Wicket on Websphere 6.1

By default, Websphere 6.1 will not process filters when they are not backed by a servlet or a page. Instead, it returns a 404 error.

To get the WicketFilter to work, you need to add a custom property to the Web container of your application server.

Go into the admin console, and select your server. Choose Web Container Settings, Web Container, Custom Properties. Add a new property called "com.ibm.ws.webcontainer.invokefilterscompatibility" and set the value to "true." Save to the master configuration and restart your server.

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

Code Block
<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>