Referer parameters filter ver. 1.3


This is a Java servlet filter (as per Servlet API 2.3). This filter checks referrer field in the source request, parses its parameters and saves them as a HashMap in the request scope. This filter lets you obtain the search words when a client comes to your site from a search engine query.

How to use it:

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

b) describe this filter in web.xml:
 


<filter>
  <filter-name>RefererParamsFilter</filter-name>
  <filter-class>com.cj.refparam.RefererParamsFilter</filter-class>
</filter>

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


<filter-mapping>
  <filter-name>RefererParamsFilter</filter-name>
  <url-pattern>*.jsp</url-pattern>
</filter-mapping>

in this case filter will be on for the each .jsp file. So in your JSP file the code:
(HashMap)request.getAttribute("RefererParameters")
will return a HashMap with parameters in referrer field for your request.

   For downloading:

    Referer parameters filter:  refparamflt.jar

 ©  Coldbeans     Comments?

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

Also in JSOS: