This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes DispatchAction problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "DispatchAction problem" Watch "DispatchAction problem" New topic
Author

DispatchAction problem

huan duong
Greenhorn

Joined: Apr 04, 2012
Posts: 3
Hi every people!

I have a problem with DispatchAction in struts framework. I don't know how can i resolve it.
Can you please help me to complete it.
My intent is when I click to "update" then screen display update massage.
Here my code:
----------------------------------------
JSP file:


----------------------------------------
Strust config file:

-----------------------------------------
Bean class: I have a form bean with message property
-----------------------------------------
Action class


Thank you very much!

huandv
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Hi Huan,

Welcome to JavaRanch!!!

What is the actual problem that you are facing?


If your struts config is same as you posted, then you have to include the forwards within action mapping's actions. example,


Have Fun with Java
little,little.. little by little makes a lot..
huan duong
Greenhorn

Joined: Apr 04, 2012
Posts: 3
Shankar Tanikella wrote:Hi Huan,

Welcome to JavaRanch!!!

What is the actual problem that you are facing?


If your struts config is same as you posted, then you have to include the forwards within action mapping's actions. example,


Thanks Shankar Tanikella!

My intent is when i click to Update/insert/delete button in DispatchAction.jsp, then a message was displayed in DispatchAction.jsp page.
But my program doesn't. I see my form bean is null.
Can you show me why my form bean is null(I assigned value in Action class ), and show me the way to display message when i click to button(use DispatchAction).

Thanks you very much!

Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Hi Huan,
Is this issue resolved? if not try to alert the form name in your javascript method [use alert(document.forms[0].name)]
Also at which point is your form null - JSP/Action? In your action class what is the ActionForm's instance [check using instanceof/debug]?
vipul bondugula
Ranch Hand

Joined: Oct 14, 2010
Posts: 218


You did not specify any validate attribute. If validate="true" is specified then if validation fails then page will navigate to the page specified in the input attribute..

Without validate how the page is navigating to DispatchAction.jsp


Thanks
Vipul Kumar
huan duong
Greenhorn

Joined: Apr 04, 2012
Posts: 3
vipul bondugula wrote:

You did not specify any validate attribute. If validate="true" is specified then if validation fails then page will navigate to the page specified in the input attribute..

Without validate how the page is navigating to DispatchAction.jsp


Thanks for your answer. I resolved my problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DispatchAction problem
 
Similar Threads
How to link different buttons to different action methods
DispatchAction error .... NoClassDefFoundError...
doen no to the desired page on clicking the button
spring jdbc and action class