?
Solved

Struts Action vs DispatchAction

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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

765 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