summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorreger <reger18@arcor.de>2014-01-23 23:56:45 +0100
committerreger <reger18@arcor.de>2014-01-23 23:56:45 +0100
commitcf553e5045ba6902df681eda617e69ddd3fe83eb (patch)
treeaedb3da29ab2760f7e7ada46ff2b997097bdb969
parent768b1306b8752995fc0c7fc59cb93c4fa01dd353 (diff)
added hint to web.xml and for completeness the full set of hardcoded mappings
-rw-r--r--defaults/web.xml33
-rw-r--r--source/net/yacy/http/Jetty8HttpServerImpl.java6
2 files changed, 35 insertions, 4 deletions
diff --git a/defaults/web.xml b/defaults/web.xml
index 7f7f2d33d..68e84d995 100644
--- a/defaults/web.xml
+++ b/defaults/web.xml
@@ -1,18 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
+ <!-- Default YaCy web.xml
+ Note: if DATA/SETTINGS/web.xml exists, it takes preference
+ -->
<display-name>YaCy</display-name>
<description>Decentralized Web Search</description>
<!-- Standard YaCy Servlets -->
<!-- Default servlet for all YaCy output
- -as this is mandatory the servlet activated automatically by the application
+ -as this is mandatory the servlet is activated automatically by the application
-no need to include this in this web.xml (provided only for completness)
<servlet>
<servlet-name>YaCyDefaultServlet</servlet-name>
<servlet-class>net.yacy.http.servlets.YaCyDefaultServlet</servlet-class>
</servlet>
+ <servlet-mapping>
+ <servlet-name>YaCyDefaultServlet</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
-->
<!-- servlet to provide direct access to the embedded solr, also used for P2P searches -->
@@ -21,6 +28,11 @@
<servlet-class>net.yacy.http.servlets.SolrSelectServlet</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>SolrServlet</servlet-name>
+ <servlet-class>net.yacy.http.servlets.SolrServlet</servlet-class>
+ </servlet>
+
<!-- servlet to provide Google Search Appliance (GSA) formatted search results -->
<servlet>
<servlet-name>GSAServlet</servlet-name>
@@ -33,12 +45,14 @@
<servlet-class>net.yacy.http.servlets.YaCyProxyServlet</servlet-class>
</servlet>
- <!-- mapping activated by the application -->
+ <!-- mappings activated by the application - hardcoded (added here for completness) -->
<servlet-mapping>
<servlet-name>SolrSelectServlet</servlet-name>
<url-pattern>/solr/select</url-pattern>
+ <url-pattern>/solr/collection1/select</url-pattern>
+ <url-pattern>/solr/webgraph/select</url-pattern>
</servlet-mapping>
-
+
<servlet-mapping>
<servlet-name>GSAServlet</servlet-name>
<url-pattern>/gsa/search</url-pattern>
@@ -47,8 +61,19 @@
<servlet-mapping>
<servlet-name>URLProxyServlet</servlet-name>
<url-pattern>/proxy.html</url-pattern>
- </servlet-mapping>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>SolrServlet</servlet-name>
+ <url-pattern>/solr/collection1/admin/luke</url-pattern>
+ <url-pattern>/solr/webgraph/admin/luke</url-pattern>
+ </servlet-mapping>
+ <!-- eof hardcoded mappings -->
+
+ <!-- additional (optional) mappings -->
+ <!-- you may add individual mappings of standard servlets here also -->
+ <!-- eof additional (optional mappings -->
+
<session-config>
<session-timeout>
30
diff --git a/source/net/yacy/http/Jetty8HttpServerImpl.java b/source/net/yacy/http/Jetty8HttpServerImpl.java
index 93b23a6ff..35aedb6fc 100644
--- a/source/net/yacy/http/Jetty8HttpServerImpl.java
+++ b/source/net/yacy/http/Jetty8HttpServerImpl.java
@@ -135,6 +135,11 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer {
//sholder.setInitParameter("welcomeFile", "index.html"); // default is index.html, welcome.html
htrootContext.addServlet(sholder,"/*");
+ // -----------------------------------------------------------------------------
+ // here we set and map the mandatory servlets, needed for typical YaCy operation
+ // to make sure they are available even if removed in individual web.xml
+ // additional, optional or individual servlets or servlet mappings can be set in web.xml
+
//add SolrSelectServlet
htrootContext.addServlet(SolrSelectServlet.class, "/solr/select"); // uses the default core, collection1
htrootContext.addServlet(SolrSelectServlet.class, "/solr/collection1/select"); // the same servlet, identifies the collection1 core using the path
@@ -148,6 +153,7 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer {
// add GSA servlet
htrootContext.addServlet(GSAsearchServlet.class,"/gsa/search");
+ // --- eof default servlet mappings --------------------------------------------
// define list of YaCy specific general handlers
HandlerList handlers = new HandlerList();