26 July 2013

It can be a bit of a pain to configure Weblogic Server to work with Struts2. This is to document what is needed so that I will have it recorded and it will also be available to others. Most of the heavy lifting was done by Amit in his article Getting Struts 2.1 to work in Weblogic 10.3. Several good comments as well.

There are some differences. I am using Maven 3 as my build tool and the Struts version is 2.3.8. First off you will need to have a Manifest file in your webapp/war in the META-INF folder. My Manifest file is completely empty. If you are familiar with Maven war projects it would have a path similar to the following

    project_root_folder/webapp/src/main/resources/META-INF/Manifest

You will also need to update your struts.properties file which will be located someplace similar to the below.

    project_root_folder/webapp/src/main/resources/struts.properties

The below entries will need to be added to the struts.properties file. The include jars entry basically adds the jar containing the actions back to the path. This is necessary because Weblogic Server changes several things about the EAR and WAR files that you deploy to the server.

struts.properties (excerpt)
#stuff omitted here
struts.convention.action.mapAllMatches = true
struts.convention.action.includeJars=.*?/_wl_cls_gen.*?jar(!/)?
struts.convention.action.fileProtocols=jar,zip
#stuff omitted here

Less Is More ~ Older posts are available in the archive.