No Query String filter ver. 1.1

This is a Java servlet filter (as per Servlet API 2.3). This filter lets you clear (eliminate) HTTP query strings in the incoming requests. With this filter for example two requests like http://your_host/index.jsp?123456 and http://your_host/index.jsp?78901 will be identical for your index.jsp page.
One of the reasons you might need such a service is a cache. What if the ability to cache depends on the incoming URI? And with the eliminated query string the requests will be identical.

How to use it:

a) download noquerystringflt.jar and save it in WEB-INF/lib

b) describe this filter in web.xml. For example:
 


<filter>
  <filter-name>NoQueryStringFilter</filter-name>
  <filter-class>com.cj.noquery.NoQueryStringFilter</filter-class>
</filter>

c) describe a mapping for this filter in web.xml
 


<filter-mapping>
  <filter-name>NoQueryStringFilter</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>

and now any incoming request will reach your JSP pages with an empty query string. Technically, API call request.getQueryString() will always return null.

   For downloading:

    No Query String filter:  noquerystringflt.jar

 ©  Coldbeans     Comments?

See also JSOS - the largest collection of servlets and filters.

Also in JSOS: