This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes link with dispatchAction doesn't transfer the form's content. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "link with dispatchAction doesn Watch "link with dispatchAction doesn New topic
Author

link with dispatchAction doesn't transfer the form's content.

Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
Hi all,

I have an dispatchAction form and a link in my jsp page. the idea, is that when the user clicks a link, the 'addLevel' method will be invoked with the level_id (as parameter) and the form's content.

I have this in my jsp:



now, when the user clicks the link '1', it goes to the addLevel method WITH the level_id (1) but WITHOUT the form's content.

why? and what can I do in order to have the form's content?

thank you
Kaustabh Singha Roy
Ranch Hand

Joined: Oct 04, 2005
Posts: 43
It will be helpful if you post the part of your struts-config.xml here. What is the scope of your form bean. If it is a request one that only the 'label' information will be stored in it. However there should be a setLabel() method present in the form class.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This doesn't work for the simple reason that clicking on a link does not submit a form. If you want to sumit the form, change the link to a submit button and make reqCode and level hidden fields on the form.


Merrill
Consultant, Sima Solutions
Peter Primrose
Ranch Hand

Joined: Sep 10, 2004
Posts: 755
thanks, I suspected that will be the reason.
thanks, I'll put buttons
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: link with dispatchAction doesn't transfer the form's content.