File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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.
 
Similar Threads
Avoiding validation when hitting the Cancel button
Multiple image buttons on a Struts Form
LookupDispatchAction Query
Hiding URL from source
Problem regarding DispatchAction