Solved

Struts Action vs DispatchAction

Posted on 2003-11-03
4
462 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
null output 3 58
String array comparison 4 57
Selenium docs api java index 3 96
Java - accessing a parent class member when another class inherits from the parent class 9 56
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
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…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

732 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