Apache Nutch is an extensible and scalable web crawler
add support for jsp templates and static resources inside plugin jars
Sami Sirendd7559d2d6b1
diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/common/WebAppModule.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/WebAppModule.javanew file mode 100644index 000000000..fd5ee6f5a--- /dev/null+++ b/contrib/web2/src/main/java/org/apache/nutch/webapp/common/WebAppModule.java@@ -0,0 +1,195 @@+/*+ * Copyright 2006 The Apache Software Foundation+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package org.apache.nutch.webapp.common;++import java.io.IOException;+import java.io.InputStream;+import java.util.ArrayList;+import java.util.HashMap;+import java.util.Iterator;+import java.util.List;+import java.util.Map;++import javax.servlet.ServletConfig;+import javax.servlet.ServletException;+import javax.servlet.http.HttpServlet;+import javax.servlet.http.HttpServletRequest;+import javax.servlet.http.HttpServletResponse;+import javax.xml.parsers.DocumentBuilderFactory;+import javax.xml.parsers.ParserConfigurationException;++import org.w3c.dom.Document;+import org.w3c.dom.Element;+import org.w3c.dom.NodeList;+import org.xml.sax.SAXException;++import java.lang.ClassLoader;++/**+ * This class is responsible for parsing web.xml definitions from plugins (put+ * there by jspc when precompiling jsp files).+ *+ * Extracted information is used at runtime when dispatching requests targetted+ * to jsp resources to the precompiled servlet classes.+ */+public class WebAppModule {++ HashMap servlets;++ List urlPatterns;++ ClassLoader loader = null;++ HashMap servletObjects = new HashMap();++ private ServletConfig servletConfig;++ /**+ * Construct new WebAppModule+ *+ * @param input+ * ionputstream to web.xml type of document+ */+ public WebAppModule(InputStream input) {+ loader = Thread.currentThread().getContextClassLoader();+ init(input);+ }++ public void init(InputStream input) {+ Document doc;+ servlets = new HashMap();+ urlPatterns = new ArrayList();++ if (input != null) {++ try {+ doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(+ input);+ parse(doc);+ } catch (SAXException e) {+ e.printStackTrace();+ } catch (IOException e) {+ e.printStackTrace();+ } catch (ParserConfigurationException e) {+ e.printStackTrace();+ }+ }+ loadServlets();+ }++ public void loadServlets() {++ Iterator i = getPaths().iterator();++ while (i.hasNext()) {++ String key = (String) i.next();+ String servletName = (String) servlets.get(key);+ HttpServlet servletObject;+ Class servletClass;+ try {+ servletClass = loader.loadClass(servletName);+ servletObject = (HttpServlet) servletClass.newInstance();+ servletObject.init(servletConfig);+ servletObjects.put(key, servletObject);+ } catch (ClassNotFoundException e) {+ e.printStackTrace();+ } catch (InstantiationException e) {+ e.printStackTrace();+ } catch (IllegalAccessException e) {+ e.printStackTrace();+ } catch (ServletException e) {+ e.printStackTrace();+ }+ }+ }++ public WebAppModule(ClassLoader loader, ServletConfig config) {+ servletConfig = config;+ this.loader=loader;+ init(loader.getResourceAsStream("META-INF/jsp-servlet-mappings.xml"));+ }++ /**+ * Get jsp paths available+ *+ * @return+ */+ public List getPaths() {+ return urlPatterns;+ }++ public Map getMappings() {+ return servlets;+ }++ /**+ * Return Servlet name for path or null if non existing+ *+ * @param path+ * @return+ */+ public String getServletName(String path) {+ return (String) servlets.get(path);+ }++ public void parse(Document doc) {++ Element root = doc.getDocumentElement();+ NodeList mappings = root.getElementsByTagName("servlet-mapping");+ for (int i = 0; i < mappings.getLength(); i++) {+ Element mapping = (Element) mappings.item(i);+ Element servlet = (Element) mapping.getElementsByTagName("servlet-name")+ .item(0);+ Element pattern = (Element) mapping.getElementsByTagName("url-pattern")+ .item(0);++ String servletName = servlet.getTextContent().trim();+ String urlPattern = pattern.getTextContent().trim();++ servlets.put(urlPattern, servletName);+ urlPatterns.add(urlPattern);+ }+ }++ /**+ * Dispatches request to precompiled jsp+ *+ * @param relPath+ * @param request+ * @param response+ */+ public void dispatch(String relPath, HttpServletRequest request,+ HttpServletResponse response) {++ HttpServlet servletObject;+ if (servletObjects.containsKey(relPath)) {+ servletObject = (HttpServlet) servletObjects.get(relPath);+ } else {+ // servlet not found??+ return;+ }+ try {+ servletObject.service(request, response);+ } catch (ServletException e) {+ // TODO Auto-generated catch block+ e.printStackTrace();+ } catch (IOException e) {+ // TODO Auto-generated catch block+ e.printStackTrace();+ }+ }+}diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/SearchController.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/SearchController.javaindex 0a636c731..f146335f1 100644--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/SearchController.java+++ b/contrib/web2/src/main/java/org/apache/nutch/webapp/controller/SearchController.java@@ -30,6 +30,9 @@ import org.apache.struts.tiles.ComponentContext;/* This is the main controller of nutch search application*/public class SearchController extends NutchController {++ public static final String REQ_ATTR_SEARCH="nutchSearch";+ public static final String REQ_ATTR_RESULTINFO="resultInfo";public void nutchPerform(ComponentContext tileContext, HttpServletRequest request,HttpServletResponse response, ServletContext servletContext)@@ -38,10 +41,10 @@ public class SearchController extends NutchController {ServiceLocator locator=getServiceLocator(request);Search search=locator.getSearch();- request.setAttribute("nutchSearch", search);+ request.setAttribute(REQ_ATTR_SEARCH, search);NutchBean bean = locator.getNutchBean();search.performSearch(bean);- request.setAttribute("resultInfo", search.getResultInfo());+ request.setAttribute(REQ_ATTR_RESULTINFO, search.getResultInfo());}}diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/JspDispatcherServlet.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/JspDispatcherServlet.javanew file mode 100644index 000000000..9cd4f4f1d--- /dev/null+++ b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/JspDispatcherServlet.java@@ -0,0 +1,85 @@+/*+ * Copyright 2006 The Apache Software Foundation+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package org.apache.nutch.webapp.servlet;++import java.io.IOException;+import java.util.HashMap;+import java.util.Iterator;++import javax.servlet.ServletConfig;+import javax.servlet.ServletException;+import javax.servlet.http.HttpServletRequest;+import javax.servlet.http.HttpServletResponse;++import org.apache.nutch.plugin.Extension;+import org.apache.nutch.plugin.ExtensionPoint;+import org.apache.nutch.webapp.common.WebAppModule;+import org.apache.nutch.webapp.extension.UIExtensionPoint;++/**+ * This Servlet is responsible for dispatching requests to jsp resources from+ * plugins.+ */+public class JspDispatcherServlet extends NutchHttpServlet {++ private static final long serialVersionUID = 1L;++ HashMap allMappings = new HashMap();++ public void init(ServletConfig conf) throws ServletException {+ super.init(conf);++ // TODO should perhaps first try handle core definitions++ // process extensions+ ExtensionPoint point = getServiceLocator().getPluginRepository()+ .getExtensionPoint(UIExtensionPoint.X_POINT_ID);++ if (point != null) {++ Extension[] extensions = point.getExtensions();++ for (int i = 0; i < extensions.length; i++) {+ Extension extension = extensions[i];++ WebAppModule module = new WebAppModule(extension.getDescriptor()+ .getClassLoader(), conf);+ Iterator iterator = module.getPaths().iterator();++ while (iterator.hasNext()) {+ String path = (String) iterator.next();+ allMappings.put(path, module);+ }+ }+ }+ }++ /**+ * Process request to jsp inside plugin (jsps must be precompiled)+ *+ */+ protected void doGet(HttpServletRequest request, HttpServletResponse response)+ throws ServletException, IOException {++ //get jsp include path_info from request object+ String relPath=(String)request.getAttribute("javax.servlet.include.path_info");++ if (allMappings.containsKey(relPath)) {+ WebAppModule module=(WebAppModule)allMappings.get(relPath);+ module.dispatch(relPath, request,response);+ }+ }+}diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/NutchHttpServlet.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/NutchHttpServlet.javaindex 383ab7a86..ccd8fe869 100644--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/NutchHttpServlet.java+++ b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/NutchHttpServlet.java@@ -18,6 +18,7 @@ package org.apache.nutch.webapp.servlet;import javax.servlet.ServletConfig;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;+import javax.servlet.http.HttpServletRequest;import org.apache.nutch.webapp.common.ServiceLocator;import org.apache.nutch.webapp.common.ServletContextServiceLocator;@@ -31,11 +32,41 @@ public abstract class NutchHttpServlet extends HttpServlet{private ServiceLocator locator;- public void init(ServletConfig servletConfig) throws ServletException {- locator = ServletContextServiceLocator.getInstance(servletConfig- .getServletContext());+ public void init(final ServletConfig servletConfig) throws ServletException {+ super.init(servletConfig);+ locator = ServletContextServiceLocator.getInstance(getServletContext());}+ /**+ * Return context relative path+ *+ * @return+ */+ public String getContextRelativePath(final HttpServletRequest request) {+ return request.getRequestURI().substring(request.getContextPath().length());+ }++ /**+ * Removes the first part of path String and returns new String+ * if there is no path available return null+ * @param path original path+ * @return+ */+ public String getMappingRelativePath(final String path){++ String relPath=null;++ if(path.indexOf("/",(path.startsWith("/")?1:0))!=-1){+ relPath=path.substring(path.indexOf('/',(path.startsWith("/")?1:0)));+ }++ return relPath;+ }++ /**+ * Get ServiceLocator instance+ * @return+ */public ServiceLocator getServiceLocator(){return locator;}diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/ResourceServlet.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/ResourceServlet.javanew file mode 100644index 000000000..d8dd14cfc--- /dev/null+++ b/contrib/web2/src/main/java/org/apache/nutch/webapp/servlet/ResourceServlet.java@@ -0,0 +1,123 @@+/*+ * Copyright 2006 The Apache Software Foundation+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package org.apache.nutch.webapp.servlet;++import java.io.IOException;+import java.io.InputStream;+import java.io.PrintWriter;++import javax.servlet.ServletException;+import javax.servlet.http.HttpServletRequest;+import javax.servlet.http.HttpServletResponse;++import org.apache.nutch.plugin.PluginDescriptor;++/**+ * Simple Servlet that serves resources from plugins.+ *+ * Plugin must put resources to be exposed into path /resources/ for example+ * resource /resources/possible/sub/folder/resource.jpg will then be available+ * in location <contextPath>/resources/<plugin_id>/possible/sub/folder/resource.jpg+ *+ */+public class ResourceServlet extends NutchHttpServlet {++ private static final String PATH = "/resources/";++ private static final long serialVersionUID = 1L;++ /**+ * Extract plugin id from path+ *+ * @param path+ * @return+ */+ private String getPluginId(final String path) {+ String pluginid = null;++ if (path != null && path.length() >= PATH.length()) {+ String stripped = path.substring(PATH.length());+ if (stripped.indexOf("/") != -1) {+ pluginid = stripped.substring(0, stripped.indexOf("/"));+ }+ }+ return pluginid;+ }++ /**+ * Extract plugin relative path from path+ *+ * @param path+ * @return+ */+ private String getPluginRelativePath(final String path) {+ String resource = path.substring(PATH.length() + getPluginId(path).length()+ + 1);+ return resource;+ }++ /**+ * Process a request for resource inside plugin+ */+ protected void doGet(HttpServletRequest request, HttpServletResponse response)+ throws ServletException, IOException {+ PluginDescriptor descriptor = null;+ String resPath = null;++ String path = getContextRelativePath(request);+ String id = getPluginId(path);+ if (id != null) {+ resPath = PATH.substring(1) + getPluginRelativePath(path);++ descriptor = getServiceLocator().getPluginRepository()+ .getPluginDescriptor(id);++ if (descriptor != null) {++ if (descriptor != null) {+ InputStream is = descriptor.getClassLoader().getResourceAsStream(+ resPath);+ if (is != null) {+ // buffer for content+ byte[] buffer = new byte[response.getBufferSize()];++ int len;+ String contentType = getServletContext().getMimeType(path).toString();++ response.setContentType(contentType);+ while ((len = is.read(buffer)) != -1) {+ // copy to outputStream+ response.getOutputStream().write(buffer, 0, len);+ }+ is.close();+ response.flushBuffer();+ return;+ }+ }+ }+ }++ //of no resource was found dispay error+ response.setContentType("text/plain");+ PrintWriter pw = response.getWriter();+ pw.println("type:" + getServletContext().getMimeType(path));+ pw.println("path:" + path);+ pw.println("plugin-id:" + id);+ pw.println("plugin:" + descriptor);+ pw.println("plugin relative path:" + resPath);+ return;+ }+}diff --git a/contrib/web2/src/main/java/org/apache/nutch/webapp/tiles/ExtendableDefinitionsFactory.java b/contrib/web2/src/main/java/org/apache/nutch/webapp/tiles/ExtendableDefinitionsFactory.javaindex bd23f4da5..628fd78ff 100644--- a/contrib/web2/src/main/java/org/apache/nutch/webapp/tiles/ExtendableDefinitionsFactory.java+++ b/contrib/web2/src/main/java/org/apache/nutch/webapp/tiles/ExtendableDefinitionsFactory.java@@ -92,9 +92,11 @@ public class ExtendableDefinitionsFactory implements DefinitionsFactory {protected XmlDefinitionsSet getDefinitions() {+ System.out.println("getDefinitions()");+XmlDefinitionsSet definitions = new XmlDefinitionsSet();//- // global definitions+ // core definitions//String configFiles = config.getDefinitionConfigFiles();LOG.info("config files:" + configFiles);@@ -103,8 +105,10 @@ public class ExtendableDefinitionsFactory implements DefinitionsFactory {LOG.info("Trying to load " + files[i]);InputStream input = servletContext.getResourceAsStream(files[i]);+ LOG.info("Stream: " + input);+if (input != null) {- parseXMLDefinitionSet(input, definitions, files[i]);+ parseXMLDefinitionSet(input, definitions, files[i], "nutch-core");} else {LOG.info("Cannot find static " + files[i]);}@@ -152,7 +156,7 @@ public class ExtendableDefinitionsFactory implements DefinitionsFactory {return;}parseXMLDefinitionSet(is, definitions, "Plugin " + extension.getId()- + " : tiles-defs.xml");+ + " : tiles-defs.xml", extension.getId());try {is.close();} catch (Exception e) {@@ -161,9 +165,12 @@ public class ExtendableDefinitionsFactory implements DefinitionsFactory {}protected void parseXMLDefinitionSet(InputStream input,- XmlDefinitionsSet definitions, String info) {+ XmlDefinitionsSet definitions, String info, String pluginid) {+ XmlDefinitionsSet newSet=new XmlDefinitionsSet();+try {- xmlParser.parse(input, definitions);+ xmlParser.parse(input, newSet);+ preprocessDefinitions(newSet);} catch (IOException e) {LOG.info("IOException (" + e.getMessage() + ") parsing definitions "+ info);@@ -176,6 +183,21 @@ public class ExtendableDefinitionsFactory implements DefinitionsFactory {LOG.info("Definitions:" + definitions.getDefinitions().size() + " : "+ definitions.toString());++ copySet(definitions,newSet);++ }++ private void copySet(XmlDefinitionsSet definitions2, XmlDefinitionsSet newSet) {++ Iterator iterator=newSet.getDefinitions().keySet().iterator();++ while(iterator.hasNext()){+ String key=(String)iterator.next();+ System.out.println("adding: -----------> " + key);+ XmlDefinition value=newSet.getDefinition(key);+ definitions2.putDefinition(value);+ }}/*@@ -202,7 +224,19 @@ public class ExtendableDefinitionsFactory implements DefinitionsFactory {Thread.currentThread().setContextClassLoader(current);this.definitions = definitions.getDefinitions();-+ }++ private void preprocessDefinitions(XmlDefinitionsSet set){+ Map definitions=set.getDefinitions();+ Iterator i=definitions.keySet().iterator();++ while(i.hasNext()){+ String key=(String)i.next();+ XmlDefinition definition=(XmlDefinition)definitions.get(key);+ if(definition.getPath()!=null && definition.getPath().startsWith("@plugin@")){+ definition.setPath("goooo" + definition.getPath());+ }+ }}private void initDefinitions(XmlDefinitionsSet definitions) {@@ -218,7 +252,6 @@ public class ExtendableDefinitionsFactory implements DefinitionsFactory {e.printStackTrace(System.out);}}- LOG.fine("Restoring ClassLoader.");}/*@@ -245,5 +278,4 @@ public class ExtendableDefinitionsFactory implements DefinitionsFactory {public DefinitionsFactoryConfig getConfig() {return config;}-}diff --git a/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestNutchHttpServlet.java b/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestNutchHttpServlet.javanew file mode 100644index 000000000..7e0aa90e8--- /dev/null+++ b/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestNutchHttpServlet.java@@ -0,0 +1,33 @@+/*+ * Copyright 2006 The Apache Software Foundation+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package org.apache.nutch.webapp.servlet;++import junit.framework.TestCase;++public class TestNutchHttpServlet extends TestCase {++ /*+ * Test method for 'org.apache.nutch.webapp.servlet.NutchHttpServlet.getMappingRelativePath(String)'+ */+ public void testGetMappingRelativePath() {++ NutchHttpServlet servlet=new NutchHttpServlet(){};++ assertEquals(null,servlet.getMappingRelativePath("test.jsp"));+ assertEquals("/kissa.jsp",servlet.getMappingRelativePath("/somepath/kissa.jsp"));+ assertEquals("/kissa.jsp",servlet.getMappingRelativePath("somepath/kissa.jsp"));+ }+}diff --git a/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestWebAppModule.java b/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestWebAppModule.javanew file mode 100644index 000000000..47d31de65--- /dev/null+++ b/contrib/web2/src/main/test/org/apache/nutch/webapp/servlet/TestWebAppModule.java@@ -0,0 +1,43 @@+/*+ * Copyright 2006 The Apache Software Foundation+ *+ * Licensed under the Apache License, Version 2.0 (the "License");+ * you may not use this file except in compliance with the License.+ * You may obtain a copy of the License at+ *+ * http://www.apache.org/licenses/LICENSE-2.0+ *+ * Unless required by applicable law or agreed to in writing, software+ * distributed under the License is distributed on an "AS IS" BASIS,+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+ * See the License for the specific language governing permissions and+ * limitations under the License.+ */+package org.apache.nutch.webapp.servlet;++import java.io.ByteArrayInputStream;++import org.apache.nutch.webapp.common.WebAppModule;++import junit.framework.TestCase;++public class TestWebAppModule extends TestCase {++ public void testWebAppModule() {+ String webxml = "<web-app><servlet-mapping><servlet-name>a</servlet-name><url-pattern>/a.jsp</url-pattern></servlet-mapping>";+ webxml += "<servlet-mapping><servlet-name>b</servlet-name><url-pattern>/b.jsp</url-pattern></servlet-mapping>";+ webxml += "<servlet-mapping><servlet-name>c</servlet-name><url-pattern>/c.jsp</url-pattern></servlet-mapping></web-app>";++ WebAppModule module;+ module = new WebAppModule(new ByteArrayInputStream(webxml.getBytes()));+ assertEquals(3, module.getPaths().size());++ assertEquals("/a.jsp", module.getPaths().get(0));+ assertEquals("/b.jsp", module.getPaths().get(1));+ assertEquals("/c.jsp", module.getPaths().get(2));++ assertEquals("a", module.getServletName("/a.jsp"));+ assertEquals("b", module.getServletName("/b.jsp"));+ assertEquals("c", module.getServletName("/c.jsp"));+ }+}diff --git a/contrib/web2/src/main/webapp/WEB-INF/web.xml b/contrib/web2/src/main/webapp/WEB-INF/web.xmlindex 5d807c908..a54657924 100755--- a/contrib/web2/src/main/webapp/WEB-INF/web.xml+++ b/contrib/web2/src/main/webapp/WEB-INF/web.xml@@ -42,6 +42,18 @@org.apache.nutch.webapp.servlet.OpenSearchServlet</servlet-class></servlet>+ <servlet>+ <servlet-name>PluginResourceServlet</servlet-name>+ <servlet-class>+ org.apache.nutch.webapp.servlet.ResourceServlet+ </servlet-class>+ </servlet>+ <servlet>+ <servlet-name>PluginJSPDispatcher</servlet-name>+ <servlet-class>+ org.apache.nutch.webapp.servlet.JspDispatcherServlet+ </servlet-class>+ </servlet><servlet-mapping><servlet-name>Cached</servlet-name><url-pattern>/servlet/cached</url-pattern>@@ -54,6 +66,14 @@<servlet-name>action</servlet-name><url-pattern>*.do</url-pattern></servlet-mapping>+ <servlet-mapping>+ <servlet-name>PluginJSPDispatcher</servlet-name>+ <url-pattern>/plugin/*</url-pattern>+ </servlet-mapping>+ <servlet-mapping>+ <servlet-name>PluginResourceServlet</servlet-name>+ <url-pattern>/resources/*</url-pattern>+ </servlet-mapping><welcome-file-list><welcome-file>index.jsp</welcome-file></welcome-file-list>