You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by an...@apache.org on 2015/05/06 21:57:47 UTC

svn commit: r1678082 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/servlet/HttpSolrCall.java core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java

Author: anshum
Date: Wed May  6 19:57:47 2015
New Revision: 1678082

URL: http://svn.apache.org/r1678082
Log:
SOLR-7500: Remove pathPrefix from SolrDispatchFilter as Solr no longer runs as a part of a bigger webapp.

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1678082&r1=1678081&r2=1678082&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Wed May  6 19:57:47 2015
@@ -107,6 +107,10 @@ Upgrading from Solr 5.1
 
   - Please refer to the "Enabling SSL" section in the Solr Reference Guide for complete details.
 
+* Support for pathPrefix has been completely removed from Solr. Since 5.0, Solr only officially
+  supported being run as a webapp but you could play around with the web.xml to have a path prefix.
+  That would no longer be true. See SOLR-7500 for more info.
+
 Detailed Change List
 ----------------------
 
@@ -327,6 +331,9 @@ Other Changes
 
 * SOLR-7102: bin/solr should activate cloud mode if ZK_HOST is set (Timothy Potter)
 
+* SOLR-7500: Remove pathPrefix from SolrDispatchFilter as Solr no longer runs as a part
+  of a bigger webapp. (Anshum Gupta)
+
 ==================  5.1.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java?rev=1678082&r1=1678081&r2=1678082&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java Wed May  6 19:57:47 2015
@@ -145,9 +145,6 @@ class HttpSolrCall {
       // this lets you handle /update/commit when /update is a servlet
       path += req.getPathInfo();
     }
-    if (solrDispatchFilter.pathPrefix != null && path.startsWith(solrDispatchFilter.pathPrefix)) {
-      path = path.substring(solrDispatchFilter.pathPrefix.length());
-    }
     // check for management path
     String alternate = cores.getManagementPath();
     if (alternate != null && path.startsWith(alternate)) {

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java?rev=1678082&r1=1678081&r2=1678082&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java Wed May  6 19:57:47 2015
@@ -84,9 +84,6 @@ public class SolrDispatchFilter extends
     log.info("SolrDispatchFilter.init()" + this.getClass().getClassLoader());
 
     try {
-      // web.xml configuration
-      this.pathPrefix = config.getInitParameter( "path-prefix" );
-
       Properties extraProperties = (Properties) config.getServletContext().getAttribute(PROPERTIES_ATTRIBUTE);
       if (extraProperties == null)
         extraProperties = new Properties();
@@ -192,43 +189,4 @@ public class SolrDispatchFilter extends
       call.destroy();
     }
   }
-
-
-
-  // TODO: Clean up - we don't need this anymore.
-  //---------------------------------------------------------------------
-  //---------------------------------------------------------------------
-
-  /**
-   * 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:
-   * <pre class="prettyprint">
-   * {@code
-   * <filter-mapping>
-   *  <filter-name>SolrRequestFilter</filter-name>
-   *  <url-pattern>/xxx/*</url-pattern>
-   * </filter-mapping>}
-   * </pre>
-   *
-   * Make sure to set the PathPrefix to "/xxx" either with this function
-   * or in web.xml.
-   *
-   * <pre class="prettyprint">
-   * {@code
-   * <init-param>
-   *  <param-name>path-prefix</param-name>
-   *  <param-value>/xxx</param-value>
-   * </init-param>}
-   * </pre>
-   */
-  public void setPathPrefix(String pathPrefix) {
-    this.pathPrefix = pathPrefix;
-  }
-
-  public String getPathPrefix() {
-    return pathPrefix;
-  }
 }