title: how to call method in action class in javascript using struts2 framework?
body: <p>I am trying to call a method in action class in javascript function on button click event which is in jsp.I am using struts 2.could you tell me how to do this?
  There is a function  in ListAlgorithmAction Class which I want to call when the user clicks submit button.
           </p>
  
  <pre><code>function alertselected (){
      var x = document.getElementById ( "select_name" ).selectedIndex;
      var y = document.getElementById ( "select_name" ).options;
      var id = y [x].index;
      redirect(id);
  }
  
  function redirect(x){
      document.getElementById ( "param_ID" ).value = x;
      document.forms ["./ListAlgorithmAction"].submit ();
  }
  </code></pre>
  
  <p></p>