web.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <web-app xmlns="http://java.sun.com/xml/ns/javaee"
  17. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  18. xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  19. version="2.5"
  20. metadata-complete="true"
  21. >
  22. <!-- Any path (name) registered in solrconfig.xml will be sent to that filter -->
  23. <filter>
  24. <filter-name>SolrRequestFilter</filter-name>
  25. <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class>
  26. <!--
  27. Exclude patterns is a list of directories that would be short circuited by the
  28. SolrDispatchFilter. It includes all Admin UI related static content.
  29. NOTE: It is NOT a pattern but only matches the start of the HTTP ServletPath.
  30. -->
  31. <init-param>
  32. <param-name>excludePatterns</param-name>
  33. <param-value>/partials/.+,/libs/.+,/css/.+,/js/.+,/img/.+,/templates/.+</param-value>
  34. </init-param>
  35. </filter>
  36. <filter-mapping>
  37. <filter-name>SolrRequestFilter</filter-name>
  38. <url-pattern>/*</url-pattern>
  39. </filter-mapping>
  40. <servlet>
  41. <servlet-name>LoadAdminUI</servlet-name>
  42. <servlet-class>org.apache.solr.servlet.LoadAdminUiServlet</servlet-class>
  43. </servlet>
  44. <servlet>
  45. <servlet-name>SolrRestApi</servlet-name>
  46. <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
  47. <init-param>
  48. <param-name>org.restlet.application</param-name>
  49. <param-value>org.apache.solr.rest.SolrSchemaRestApi</param-value>
  50. </init-param>
  51. </servlet>
  52. <servlet-mapping>
  53. <servlet-name>LoadAdminUI</servlet-name>
  54. <url-pattern>/index.html</url-pattern>
  55. </servlet-mapping>
  56. <servlet-mapping>
  57. <servlet-name>SolrRestApi</servlet-name>
  58. <url-pattern>/schema/*</url-pattern>
  59. </servlet-mapping>
  60. <mime-mapping>
  61. <extension>.xsl</extension>
  62. <!-- per http://www.w3.org/TR/2006/PR-xslt20-20061121/ -->
  63. <mime-type>application/xslt+xml</mime-type>
  64. </mime-mapping>
  65. <welcome-file-list>
  66. <welcome-file>index.html</welcome-file>
  67. </welcome-file-list>
  68. <!-- Get rid of error message -->
  69. <security-constraint>
  70. <web-resource-collection>
  71. <web-resource-name>Disable TRACE</web-resource-name>
  72. <url-pattern>/</url-pattern>
  73. <http-method>TRACE</http-method>
  74. </web-resource-collection>
  75. <auth-constraint/>
  76. </security-constraint>
  77. <security-constraint>
  78. <web-resource-collection>
  79. <web-resource-name>Enable everything but TRACE</web-resource-name>
  80. <url-pattern>/</url-pattern>
  81. <http-method-omission>TRACE</http-method-omission>
  82. </web-resource-collection>
  83. </security-constraint>
  84. <!--
  85. RedirectServlet can be used to redirect old endpoints to a new location to support back compatibility.
  86. Example below
  87. -->
  88. <!--
  89. <servlet>
  90. <servlet-name>RedirectOldZookeeper</servlet-name>
  91. <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
  92. <init-param>
  93. <param-name>destination</param-name>
  94. <param-value>${context}/admin/zookeeper</param-value>
  95. </init-param>
  96. </servlet>
  97. <servlet-mapping>
  98. <servlet-name>RedirectOldZookeeper</servlet-name>
  99. <url-pattern>/zookeeper</url-pattern>
  100. </servlet-mapping>
  101. -->
  102. </web-app>