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
- Since:
- solr 1.2
Method Summary |
protected CoreContainer.Initializer |
createInitializer()
Method to override to change how CoreContainer initialization is performed. |
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)
|
CoreContainer |
getCores()
|
protected int |
getErrorInfo(Throwable ex,
NamedList info)
|
String |
getPathPrefix()
|
void |
init(javax.servlet.FilterConfig config)
|
protected void |
sendError(SolrCore core,
SolrQueryRequest req,
javax.servlet.ServletRequest request,
javax.servlet.http.HttpServletResponse response,
Throwable ex)
|
void |
setPathPrefix(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 |
cores
protected volatile CoreContainer cores
pathPrefix
protected String pathPrefix
abortErrorMessage
protected String abortErrorMessage
parsers
protected final Map<SolrConfig,SolrRequestParsers> parsers
adminRequestParser
protected final SolrRequestParsers adminRequestParser
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
getCores
public CoreContainer getCores()
createInitializer
protected CoreContainer.Initializer createInitializer()
- Method to override to change how CoreContainer initialization is performed.
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
getErrorInfo
protected int getErrorInfo(Throwable ex,
NamedList info)
execute
protected void execute(javax.servlet.http.HttpServletRequest req,
SolrRequestHandler handler,
SolrQueryRequest sreq,
SolrQueryResponse rsp)
sendError
protected void sendError(SolrCore core,
SolrQueryRequest req,
javax.servlet.ServletRequest request,
javax.servlet.http.HttpServletResponse response,
Throwable ex)
throws IOException
- Throws:
IOException
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 /*, perhaps because you are merging this
filter into a larger web application.
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 © 2000-2012 Apache Software Foundation. All Rights Reserved.