title: How to call controller class from jsp in spring
body: <p>I want to store the users every detail like users-agent and some more headers and the name of url page which user hit recently for that i have made one controller class for storing all detail  and i have more than 20 pages  how can call HelloController class from the back end when user hit on my jsp pages so that i store the all headers ,time and  url in the database</p>
  
  <pre><code>    @Controller
      public class HelloController {
  
          @RequestMapping(value = "/StroreHits")
          public String hello(
                  @RequestHeader(value="Accept") String accept,
                  @RequestHeader(value="Accept-Language") String acceptLanguage,
                  @RequestHeader(value="User-Agent", defaultValue="foo") String userAgent,
                  HttpServletResponse response) {
  
              System.out.println("accept: " + accept);
              System.out.println("acceptLanguage: " + acceptLanguage);
              System.out.println("userAgent: " + userAgent);
            String url_name   = request.getRequestURL().toString() + "?" + request.getQueryString()
  
           StoreHits sh =  new StoreHits ();
  sh.insertValues(accept,acceptLanguage,userAgent,name);
              return null;
          }
  
      }
  </code></pre>