Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Struts Action vs DispatchAction

Posted on 2003-11-03
4
Medium Priority
?
479 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 300 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

618 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