title: How do I call a spring controller through plain javascript function
body: <p>Note: I do not want ajax or jquery implementation because such approaches are already on stack. 
  Please Help Soon. </p>
  
  <p>Here is the code for reference</p>
  
  <pre><code> &lt;div class="col-lg-3  col-xs-12  "&gt;
                          &lt;div class="small-box bg-aqua" id="java" onclick="myFunc(this.id);"&gt;
                              &lt;a class="small-box-footer"&gt; JAVA &lt;/a&gt;
                              &lt;div class="inner"&gt;
                                  &lt;h3&gt;&lt;c:out value="${javaCount}"/&gt;&lt;/h3&gt;  
                                  &lt;p&gt;Java&lt;/p&gt;
                              &lt;/div&gt;
                              &lt;span class="icon" style="padding-top: 27px;"&gt; &lt;i
                                  class="fa fa-book  "&gt;
                                  &lt;/i&gt;
                              &lt;/span&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
  </code></pre>
  
  <p>On click of above modal call's the below function</p>
  
  <pre><code>   function myFunc(id){
      alert(id)
      $('#').attr('action','${pageContext.request.contextPath}/viewSpecificBook?data='+ id);
      $('#').submit();
  }
  </code></pre>
  
  <p>Now the above function should call the following spring Controller</p>
  
  <pre><code>@RequestMapping(value="viewSpecificBook", method = RequestMethod.GET)
  public ModelAndView viewSpecificBook()
  {
  
  
  }
  </code></pre>
  
  <p>After debugging I have noticed that the control is not forwarded to the spring but it reaches the javascript function.</p>
  
  <p>Please Help!</p>