Child pages
  • WebSphere
Skip to end of metadata
Go to start of metadata

WebSphere 5.1

(tick) Be sure to install WebSphere's Fix Pack 1.

WebSphere 6

See forum thread:

It looks like there is a bug in WebSphere App Server related to which classloader is used at the time that Struts2 is loading the properties files, (all properties files, not just and The bug may have been fixed in WAS, (check out this link for details

If you just want to confirm the issue, or you need just a temporary fix, try this:

1) jar up all properties files for your project, (including in its full path), and put these into the WS common applications lib directory at the same level as the "profiles" directory.
2) Run the application - everything should work

This solution is strictly temporary, as all struts2 apps in this instance of WAS would have to use the same properties files. A better solution:

1) add a servlet that initializes the Struts Dispatcher with the servlet context:

2) launch it at start-up (web.xml):

3) Run application and everything should work.

WebSphere 6.5

To make struts2 work in Websphere, one has to set Websphere specific properties, you may want to add that to the wiki:

The properties are: = true = true

At least that is necessary when using StrutsPrepareAndExecuteFilter.

In Websphre admin console one has to add those properties here:

Servers > Application servers > {server name} > Web container > Custom Properties

A wsadmin jython script to set those properties could look like this:

Thanks to Christoph Nenning (christoph dot nenning at lex-com at net)


IBM WebSphere Application Server uses the JSESSIONID information to keep track of the client session. If you have an application where the application client must navigate across multiple WebSphere Application Server nodes residing in same domain, then the JSESSIONID information may be over-written on the client because multiple JSESSIONID cookies received with the same name and path.

When persistence is disabled and if the JSESSIONID in the incoming request is not found in the current session manager, then the session manager will generate a new sessionId and create a session object, instead of using the sessionId in the incoming request.

To resolve this issue, configure WebSphere Application Server to reuse the sessionId present in the incoming request.

For All versions:

  1. Open the administrative console.
  2. Select Servers > Application Servers > Server_Name > Server Infrastructure > Java and Process Management > Process Definition > Java Virtual Machine > Custom Properties > New
  3. Add a new Custom Property for the JVM to reuse the sessionId:
    System Property Name: HttpSessionIdReuse
    System Property Value: true
  4. Save your changes and restart the Application Server.

If the application client does not navigate across multiple WebSphere Application Server nodes residing in the same domain but there are multiple WARs with different context roots, following is the step that needs to be followed for session to be maintained in one web application:

  1. Open the administrative console.
  2. Select Application servers > Server_Name > Session management > Cookies
  3. In "Cookie Path", specify the context root of web application in which session needs to be maintained. This will ensure that cookies are sent only to /<<context_root>> URL and prevent overriding of JSSESSIONID cookie which results in new session creation by WAS.
  4. Save your changes and restart the Application Server.

Thanks to Vineet Kanwal from IBM!

  • No labels


  1. Dispatcher instantiation should be:

    Dispatcher d = new Dispatcher(getServletContext(), new HashMap<String, String>());

  2. WebSphere 6.1 with fixpacks later than requires the following flag to be set in the custom properties for the web container: = true

    If this is not set the filter does not work correctly and you will only receive 404s.

  3. Could somebody with enough karma please fix the code (Jason is right, the constructor expects an additional argument).

    Furthermore the link to the opensymphony forum is broken, it should be

  4. WebSphere App Server 7.0 has a bug in it which prevents web container security from being implemented. This is scheduled to be fixed in fixpack which is due out in July 2009. If you have already created your project using the Rational Application Developer 7.5 and the project is using servlet spec 2.5, then you will not be able to deploy to WAS 6.1 even with its fixpacks. You'll need to use another app server instead or until this fixpack is availalble. Tomcat worked like a charm on my project.

    Similarly, WAS 6.1 should be patched to or higher for the same reasons.