Skip to content Skip to sidebar Skip to footer

Passing A Parameter From Jsp To Action Class In Struts 2

I am trying to pass value of a text-field as a URL parameter from a JSP to an action class on clicking of a button(non-submit button) and have found a solution in this link: Onchan

Solution 1:

First, you have made a typo in code == vs =

window.location="getDealersByGrouppopUpAction?reportGroup="+rep_value;

Second, this sounds like redirect to the action, for calling action use s:action or $.ajax() see example.

Trird, for URLs better use s:url tag to build the url.

var url = "<s:url action='getDealersByGrouppopUpAction'/>"+"?reportGroup="+rep_value;
window.location=url;

Post a Comment for "Passing A Parameter From Jsp To Action Class In Struts 2"