Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

DispatchAction problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]?
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic