OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Pass value from javascript in jsp to action class in struts2

  • Thread starter Thread starter Soham
  • Start date Start date
S

Soham

Guest
how can i pass value from javascript to a java class in struts2? This is the link similar to what I want.However it does not work for me. I have tried something like this. Struts tag for hidden in jsp is

Code:
    function redirect(id)
    {
    window.alert("Hello"+id);
    document.getElementById('param_ID').value=id;
    document.forms["./ListAlgorithmAction"].submit();
    }

In my action class I have declared getter and setter for the param_ID.But it returns null.

Kindly help. Thank you.

<p><a href="https://stackoverflow.com/questions...ue-from-javascript-to-a-java-class-in-struts2">how can i pass value from javascript to a java class in struts2?</a>
This is the link similar to what I want.However it does not work for me.
I have tried something like this.
Struts tag for hidden in jsp is </p>

<pre><code> function redirect(id)
{
window.alert("Hello"+id);
document.getElementById('param_ID').value=id;
document.forms["./ListAlgorithmAction"].submit();
}
</code></pre>

<p>In my action class I have declared getter and setter for the param_ID.But it returns null.</p>

<p>Kindly help.
Thank you.</p>
 

Latest posts

ن
Replies
0
Views
1
نعمان منذر محمود الجميلي
ن
Top