First request filter ver. 1.1


This is a Java servlet filter (as per Servlet API 2.3). This filter lets you detect the very first request from the user and forward it to the splash screen. E.g. your site will show full screen ad for the first request etc.

How to use it:

a) download firstrequestflt.jar and save it in WEB-INF/lib directory. An initial parameter splash describes an URI for your splash screen.

for example:
 


<filter>
  <filter-name>FirstRequestFilter</filter-name>
  <filter-class>com.cj.accessflt.FirstRequestFilter</filter-class>
  <init-param>
    <param-name>splash</param-name>
    <param-value>/ad.jsp</param-value>
  </init-param>
</filter>

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


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

in this example filter will be on for the each file.

And now the first user's request to any JSP file will be forwarded to your splash screen (file ad.jsp in this example).

In you JSP splash file (splash screen) you can get request scope attribute javax.servlet.forward.request_uri and obtain an original URI.

   For downloading:

    First request filter:  firstrequestflt.jar
 

 ©  Coldbeans     Comments?

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

Also in JSOS: