wood burning stoves
The moose likes Struts and the fly likes Struts with javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts with javascript" Watch "Struts with javascript" New topic

Struts with javascript

piyush kumar

Joined: Feb 01, 2007
Posts: 20
Hi all,
i have one jsp which is called viewserver.jsp and viewaction class, now what i am doing is ion my jsp there are some radio buttons and corresponding values of the radio button. now when i click on the radio button iot calls a javascript function serverid(this.form, this.value) in which i am passing the form and the corresponding value which is clicked . now i want that this value should be transffered to my Action class which uis viewaction for furthur processing. c an anybody tell me how to transfer the single value to the action class.
thanks in advance
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Why not just submit the form? Then the action class can just read the value from the request.

If you want to communicate with the Action without submitting the form, you will have to use an AJAX call.

Consultant, Sima Solutions
John Simpson

Joined: Sep 10, 2007
Posts: 25
To further elaborate on Merrill's point,

Make sure that you have an id for the element, and also make sure that the ActionForm of your jsp has corresponding setters/getters for the parameter of that id.
I agree. Here's the link: http://aspose.com/file-tools
subject: Struts with javascript
It's not a secret anymore!