This is a Java servlet filter (as per Servlet API 2.3). PopunderFilter lets you add JavaScript popup to all responses. And new window will be opened below your main screen. For example, you may show some advertising, announces etc. Initial parameters for this filter describe your own settings for JavaScript window. How to use it: a) download popunderflt.jar and save it in WEB-INF/lib b) describe this filter in web.xml. There are two initial
parameters:
<filter> <filter-name>PopunderFilter</filter-name> <filter-class>com.cj.popunder.PopunderFilter</filter-class> <init-param> <param-name>url</param-name> <param-value>http://www.acme.com/banner.cgi</param-value> </init-param> <init-param> <param-name>window</param-name> <param-value>width=530, height=300, location=no, toolbar=no, menubar=no, scrollbars=yes, resize=yes, top=30, left=30</param-value> </init-param> </filter> c) describe a mapping for this filter in web.xml
<filter-mapping> <filter-name>PopunderFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> in this case filter will be on for the each .jsp file. And for the each request filter will add the following
JavaScript code to the given response:
<script language="JavaScript"> pu=window.open('http://www.acme.com/banner.cgi', 'PopunderFilter', 'width=530, height=300, location=no, toolbar=no, menubar=no, scrollbars=yes, resize=yes, top=30, left=30'); pu.blur(); window.focus(); </script> For downloading:
See also JSOS - the largest collection of servlets and filters.
|
Also in JSOS:
|