Make a web site - import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletRequest; import javax.servlet.ServletContext;
import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletRequest; import javax.servlet.ServletContext; import javax.servlet.ServletResponse; import javax.servlet.ServletException; /** * An example servlet filter class. */ public class LoggingFilter implements Filter{ public final static String LOG_FILE_PARAM = “log_file_name”; private FilterConfig filterConfig = null; private ServletContext servletContext = null; public void init( FilterConfig config ) throws ServletException { // Initialize any neccessary resources herethis.filterConfig = config; this.servletContext = config.getServletContext( ); // You can get access to initialization parameters from web.xml // although this example doesn’t really use itString logFileName = config.getInitParameter( LOG_FILE_PARAM ); // You can log messages to the servlet log like thislog( “Logging to file ” + logFileName ); // Maybe initialize a third-party logging frameworklike log4j} public void doFilter( ServletRequest request, ServletResponse response, FilterChain filterChain ) throws IOException, ServletException { // Log a message here using the request data log( “doFilter called on LoggingFilter” ); // All request and response headers are available to thefilter log( “Request received from ” + request.getRemoteHost( ) ); // Call the next filter in the chainfilterChain.doFilter( request, response );
Please visit Domain Name Hosting services for high quality webhost to host and run your jsp applications.