title: HTML Encoding of request parameters
body: <p>My application is a Spring MVC application, does not use annotations (its quite an old application though it uses spring 3.1.1). </p>
  
  <p>I have a JSP page that can be invoked via a tool like curl or directly from the web browser URL. The URL accepts a request parameter called location</p>
  
  <pre><code>http://localhost:8080/testdomain/registeruser.do?mylocation=fr
  </code></pre>
  
  <p>On invoking the above url, I call an implementation of SimpleFormController that reads the request parameter "mylocation"</p>
  
  <p>How do I html encode the request parameter "mylocation". Before reading the parameter from the request [request.getParameter("mylocation")] in my controller, would is suffice if I call HtmlUtils.htmlEscape(request.getParameter("mylocation"))</p>
  
  <p>Please note there is no form backing the input parameter for mylocation, as outlined earlier I could call this from a command line tool or browser URL.</p>