From 6459f8e5bcc2a1ea1dbda183e20e17f300182fcb Mon Sep 17 00:00:00 2001 From: Gavin Lambert Date: Mon, 10 Jun 2013 20:52:28 +1200 Subject: [PATCH] Fix up web.xml config Add missing WebServlet annotation to JavascriptConfigServlet class, for consistency. Remove redundant configuration items from web.xml, as on Tomcat 7 with default settings these cause the following error: java.lang.IllegalArgumentException: The servlets named [JavascriptConfigServlet] and [net.socialgamer.cah.servlets.JavascriptConfigServlet] are both mapped to the url-pattern [/js/cah.config.js] which is not permitted --- WebContent/WEB-INF/web.xml | 32 ------------------- .../cah/servlets/JavascriptConfigServlet.java | 2 ++ 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml index 45ee8b1..3cbeffc 100644 --- a/WebContent/WEB-INF/web.xml +++ b/WebContent/WEB-INF/web.xml @@ -6,38 +6,6 @@ index.htm index.jsp - - AjaxServlet - net.socialgamer.cah.servlets.AjaxServlet - - - JavascriptConfigServlet - net.socialgamer.cah.servlets.JavascriptConfigServlet - - - LongPollServlet - net.socialgamer.cah.servlets.LongPollServlet - - - Schema - net.socialgamer.cah.servlets.Schema - - - AjaxServlet - /AjaxServlet - - - JavascriptConfigServlet - /js/cah.config.js - - - LongPollServlet - /LongPollServlet - - - Schema - /Schema - net.socialgamer.cah.StartupUtils diff --git a/src/net/socialgamer/cah/servlets/JavascriptConfigServlet.java b/src/net/socialgamer/cah/servlets/JavascriptConfigServlet.java index 7f0c592..2b37223 100644 --- a/src/net/socialgamer/cah/servlets/JavascriptConfigServlet.java +++ b/src/net/socialgamer/cah/servlets/JavascriptConfigServlet.java @@ -5,11 +5,13 @@ import java.io.PrintWriter; import javax.servlet.ServletConfig; import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +@WebServlet("/js/cah.config.js") public class JavascriptConfigServlet extends HttpServlet { private static final long serialVersionUID = 4287566906479434127L;