Tag Archives: servlets
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> Now, we want … Continue reading
Character Encodings Bite Again
A colleague gave me a nudge today. “This page doesn’t validate because of an encoding error”. It was fairly simple: the string “JimĂ©nez” contained a single byte—Latin1. Ooops. It turned out that we were generating the page as ISO-8859-1 instead … Continue reading
Servlets vs mod_perl
I’ve been looking at the Java servlets stuff for a couple of days now and it’s clear that it bears a remarkable similarity to mod_perl. In mod_perl, you define handler() which gets passed a $r object to deal with the … Continue reading