SOLR-350, for non-handler reqeusts, select core with 'String corename = request.getParameter("core");'

This is a temporary fix till we figure something more complex to forward to jsp files

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@603269 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan McKinley 2007-12-11 15:21:35 +00:00
parent bd0e6827f2
commit 2181f52f66
1 changed files with 12 additions and 0 deletions

View File

@ -247,6 +247,18 @@ public class SolrDispatchFilter implements Filter
// otherwise, let's ensure the core is in the SolrCore request attribute so
// the servlet can retrieve it
else {
// TEMP -- to support /admin multicore grab the core from the request
// TODO -- for muticore /admin support, strip the corename from the path
// and forward to the /admin jsp file
// req.getRequestDispatcher( path ).forward( request, response );
String corename = request.getParameter("core");
if( corename != null ) {
core = multicore.getCore( corename );
if( core == null ) {
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,
"Can not find core: '"+corename+"'" );
}
}
req.setAttribute("org.apache.solr.SolrCore", core);
}
}