jodd.lagarto.filter
Class LagartoServletFilter

java.lang.Object
  extended by jodd.lagarto.filter.LagartoServletFilter
All Implemented Interfaces:
javax.servlet.Filter
Direct Known Subclasses:
SimpleLagartoServletFilter

public abstract class LagartoServletFilter
extends java.lang.Object
implements javax.servlet.Filter

Lagarto servlet filter takes HTML content and invokes user defined parser on it. This filter is a generic one and does not use Lagarto parser explicitly. It just gives a placeholder where user can add it's own parsing mechanism.


Constructor Summary
LagartoServletFilter()
           
 
Method Summary
protected  boolean acceptActionPath(javax.servlet.http.HttpServletRequest request, java.lang.String actionPath)
          Accepts action path for further parsing.
 void destroy()
           
 void doFilter(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, javax.servlet.FilterChain filterChain)
          Wraps the response and parse it using Lagarto parser.
 void init(javax.servlet.FilterConfig filterConfig)
           
protected abstract  char[] parse(char[] content, javax.servlet.http.HttpServletRequest request)
          Main method that parses content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LagartoServletFilter

public LagartoServletFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig filterConfig)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Throws:
javax.servlet.ServletException

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest servletRequest,
                     javax.servlet.ServletResponse servletResponse,
                     javax.servlet.FilterChain filterChain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Wraps the response and parse it using Lagarto parser.

Specified by:
doFilter in interface javax.servlet.Filter
Throws:
java.io.IOException
javax.servlet.ServletException

acceptActionPath

protected boolean acceptActionPath(javax.servlet.http.HttpServletRequest request,
                                   java.lang.String actionPath)
Accepts action path for further parsing. By default, only *.htm(l) requests are passed through and those without any extension.


parse

protected abstract char[] parse(char[] content,
                                javax.servlet.http.HttpServletRequest request)
Main method that parses content. It can use Lagarto parser or any other custom parsing technology.



Copyright © 2003-2012 Jodd Team