Tag Archives: happygiraffe

Mapping a servlet to /

An interesting problem cropped up today. We want to use a servlet for the home page in a Spring Web MVC project. Initially we had this in web.xml. <servlet> <servlet-name>foo</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>foo</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping> &lt;servlet&gt; &lt;servlet-name&gt;foo&lt;/servlet-name&gt; &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;foo&lt;/servlet-name&gt; &lt;url-pattern&gt;*.html&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; Now, we want to add in a handler specifically […]

Tomcat Logging in WTP

I’ve just been trying to enable debug logging for tomcat (don’t ask). Normally you do this by editing $CATALINA_HOME/conf/logging.properties and restarting. Except I tried that in Eclipse (using WTP) and it didn’t work. I tried copying it to the $CATALINA_BASE/conf directory instead1. Still no joy. I’ve just found the answer, after looking in the tomcat […]