File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DispatchAction problem

 
huan duong
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 329
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
huan duong
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 329
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 219
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
 
huan duong
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic