org.apache.solr.servlet
Class SolrDispatchFilter
java.lang.Object
org.apache.solr.servlet.SolrDispatchFilter
- All Implemented Interfaces:
- javax.servlet.Filter
public class SolrDispatchFilter
- extends java.lang.Object
- implements javax.servlet.Filter
This filter looks at the incoming URL maps them to handlers defined in solrconfig.xml
Method Summary |
void |
destroy()
|
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
|
protected void |
execute(javax.servlet.http.HttpServletRequest req,
SolrRequestHandler handler,
SolrQueryRequest sreq,
SolrQueryResponse rsp)
|
java.lang.String |
getPathPrefix()
|
void |
init(javax.servlet.FilterConfig config)
|
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 |
protected void |
sendError(javax.servlet.http.HttpServletResponse res,
java.lang.Throwable ex)
|
void |
setHandleSelect(boolean handleSelect)
|
void |
setPathPrefix(java.lang.String pathPrefix)
set the prefix for all paths. |
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 java.lang.String pathPrefix
abortErrorMessage
protected java.lang.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 java.io.IOException,
javax.servlet.ServletException
- Specified by:
doFilter
in interface javax.servlet.Filter
- Throws:
java.io.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,
java.lang.Throwable ex)
throws java.io.IOException
- Throws:
java.io.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(java.lang.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 java.lang.String getPathPrefix()
Copyright © 2006 - 2009 The Apache Software Foundation