Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page is meant to be a list of issues and solutins that users ave encountered while migrations existing Struts 1 application to Struts 2, or developing new Webwork-based applications. If you have a solution to the issue that will of course be most helpful, but even if you don't it is worth noting what you encountered none the less in the hopes that someone else can come along and answer it for you, and the rest of us.

  • How do we change the location of the struts.xml file?
  • How do we set checkboxes false (on uncheck)?
  • How can we set the focus on a form field?
  • What is the analogy to ForwardAction?
  • How do we extend an action mapping in struts.xml?
  • Can we use DynaBeans?
  • How do we set a token to track duplicate submits?

How do we change the location of the struts.xml file?

Struts 2 uses a different approach to loading the configuration. The initial struts.xml is loaded from the root of the classpath. The easiest way to set that up is to put the struts.xml under the classes folder.

If maintaining the struts.xml under classes doesn't work for you, then use the "boostrap" struts.xml to include whatever other struts.xml's you'd like.

Code Block

<struts>
   <include file="..\struts.xml"/>
</struts>

Or, chuck it all and use Zero Configuration (smile)

How do we set checkboxes false (on uncheck)?

...