Solved

Struts Action vs DispatchAction

Posted on 2003-11-03
4
448 Views
Last Modified: 2007-12-19
I have a piece of code, and I'll post it if necessary, but I suspect this is a known issue.

Works great if I use an Action class that has an execute() method.

I refactored it so that instead it uses a DispatchAction method. I pass in a parameter that tells it to call a save() method in it.

It works, EXCEPT:

If the validate() method of the ActionForm fails, I still get sent back to the jsp page (because of an input= line in the action mapping) BUT the user's input is gone, and the html:error tags telling the user what he did wrong don't show anything.

Is there something broken about DispatchAction???
0
Comment
Question by:JavaWannaBee
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
Jim Cakalic earned 75 total points
ID: 9673878
Hmm. Do you have 'redirect="true"' in the forward?
0
 

Author Comment

by:JavaWannaBee
ID: 9675047
No. I added it and no change.

I mispoke on one thing.

It IS reloading the jsp page and the data the user entered. I notice the url loses the sessionid when it does that though.

What it is not doing is showing the html errors. I am going to double check that the message resource bundle is working, but it was before.
0
 

Author Comment

by:JavaWannaBee
ID: 9675859
Was a mapping resource issue. You get the points since you tried :-)
0
 
LVL 19

Expert Comment

by:Jim Cakalic
ID: 9678955
OK. Thanks -- although I feel as though I didn't earn them. :-)
Jim
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now