title: Ways to access the query parameters JSP, JSTL, Javascript
body: <p>I have been using the following 3 ways to access the query parameters in the URL.</p>
  
  <p>JSP</p>
  
  <pre><code>String success = request.getParameter("success");
  if(success!=null) {
  //do something
  }
  </code></pre>
  
  <p>JSTL</p>
  
  <pre><code>&lt;c:if test="${not empty param.success}"&gt;
  //do something
  &lt;/c:if&gt;
  </code></pre>
  
  <p>JavaScript</p>
  
  <pre><code>function getQueryParameter ( parameterName ) {
    var queryString = window.top.location.search.substring(1);
    var parameterName = parameterName + "=";
    if ( queryString.length &gt; 0 ) {
      begin = queryString.indexOf ( parameterName );
      if ( begin != -1 ) {
        begin += parameterName.length;
        end = queryString.indexOf ( "&amp;" , begin );
          if ( end == -1 ) {
          end = queryString.length
        }
        return unescape ( queryString.substring ( begin, end ) );
      }
    }
    return "null";
  }
  </code></pre>
  
  <p>All 3 of these work for me, but I would like to know if there is any of these has any issue and which one is preferred?</p>