org.apache.solr.servlet
Class SolrDispatchFilter
java.lang.Object
org.apache.solr.servlet.SolrDispatchFilter
- All Implemented Interfaces:
- javax.servlet.Filter
public class SolrDispatchFilter
- extends Object
- implements javax.servlet.Filter
This filter looks at the incoming URL maps them to handlers defined in solrconfig.xml
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
core
protected SolrCore core
parsers
protected SolrRequestParsers parsers
handleSelect
protected boolean handleSelect
pathPrefix
protected String pathPrefix
abortErrorMessage
protected String abortErrorMessage
SolrDispatchFilter
public SolrDispatchFilter()
init
public void init(javax.servlet.FilterConfig config)
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 request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
- Specified by:
doFilter
in interface javax.servlet.Filter
- Throws:
IOException
javax.servlet.ServletException
execute
protected void execute(javax.servlet.http.HttpServletRequest req,
SolrRequestHandler handler,
SolrQueryRequest sreq,
SolrQueryResponse rsp)
sendError
protected void sendError(javax.servlet.http.HttpServletResponse res,
Throwable ex)
throws IOException
- Throws:
IOException
isHandleSelect
public boolean isHandleSelect()
- Should the filter handle /select even if it is not mapped in solrconfig.xml
This will use consistent error handling for /select?qt=xxx and /update/xml
setHandleSelect
public void setHandleSelect(boolean handleSelect)
setPathPrefix
public void setPathPrefix(String pathPrefix)
- set the prefix for all paths. This is useful if you want to apply the
filter to something other then *.
For example, if web.xml specifies:
SolrRequestFilter
/xxx/*
Make sure to set the PathPrefix to "/xxx" either with this function
or in web.xml
path-prefix
/xxx
getPathPrefix
public String getPathPrefix()
Copyright © 2006 - 2009 The Apache Software Foundation