Versions Compared

Key

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

This page is meant to be a list of issues and solutins solutions that users ave encountered while migrations migrating 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 to 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?

...

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

...

Code Block
<action name="Welcome" class="com.company.Foo">
<result>/pages/Welcome.jsp</result>
</action>

...

The Token Interceptor is most like the Struts 1 approach, except that we don't have to change the Action class to add a lot of busy code. The tradeoff trade off is that we do have to include the token tag in the form, to bootstrap the process. In Struts 1, we set the token in the Action, and the form tag detected it. In Struts 2, we set the token in the page, and the Interceptor detects it.

If the Interceptor does detects detect a duplicate submit, then it automatically returns an "invalid.token" result code, which can be handled via the action mapping.

...