Question

I have retrieved the value of postCode and assigned the same in

document.getElementById("zipCode").innerHTML=postcode;

I am able to access the same using <div id="zipCode">. I want to store the value of ZipCode in a variable or a dsp:param value in JSP such that i can pass this value in my nested JSP(s). Any help regarding this will be highly appreciated.

Was it helpful?

Solution 3

I finally figured out a solution for the same. I stored the value in a Cookie through Java script and in turn used the Cookie in my Java class to retrieve the Cookie Value.

OTHER TIPS

You can't do that.

Where as javascript plays on browser i.e on client side.

And jsp plays on server side. I.e Server side.

Inorder to pass that variable to serverside(jsp or what ever you have to make a request).

Why dont you fill an hidden input on your form, than, when you submit the form a param with this hidden input name will be passed together, than you will be able to get this parameter with dsp:param.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top