java - How to send parameter to a jsp page using querystring via a controller in spring framework? -



java - How to send parameter to a jsp page using querystring via a controller in spring framework? -

i have jsp page containing info table. want pass content of first column of row ,when clicked, jsp page. working spring framework. have tried accomplish it,but problem. problem : when retrieving parameter in jsp page, content,but contents after first blank space skipped.

here code have tried: source jsp page:

$(document).ready(function(){ $("#mytable tbody tr").click(function(){ var apos = $('#mytable').datatable().fngetposition(this); var adata = $('#mytable').datatable().fngetdata(apos); pass_on=adata[0]; window.location.href = "/test/integrate"+"?"+"group="+pass_on; }); });

the controller:

@requestmapping(value="/test/integrate", method = requestmethod.get) public string pass_parameter_by_type(modelmap model,httpservletrequest request,httpservletresponse response) { homecoming "destination"; }

the destination jsp page:

<body> <input type="button" id="sub_but"> <input type="hidden" value=<%=request.getparameter("group") %> id="group_parameter"> $("#sub_but").click(function(){ alert($("#group_parameter").val()); }); </body>

if value passed "cool guy", in url shows test/integrate?group=cool guy. in alert shows "cool". please help.

you need pass cool%20guy.

urls don't understand special chars

http://www.w3schools.com/tags/ref_urlencode.asp

java javascript spring jsp spring-mvc

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -