[Building Sakai] Servlet mappings for JS, CSS, etc

Jim Eng jimeng at umich.edu
Thu Feb 28 10:00:03 PST 2013


I'm having a little trouble with the web.xml file for a contrib webapp. The web.xml file uses a "url-pattern" tag to map "/*" to the servlet.  That works fine except that it also maps "/js/*" and "/css/*" to the servlet, so they don't get served.  

I read suggestions about handling this (not in sakai) in a couple places, including tomcat docs and some stackoverflow posts.  They suggested mapping to the default servlet (org.apache.catalina.servlets.DefaultServlet). That works just fine, except it seems that none of the webapps in sakai core do it that way, though many of them have CSS, JS and image files that are served from their webapp wars.  

And I came across an old JIRA ticket (http://jira.sakaiproject.org/jira/browse/SAK-14404) that seems to indicate a mapping to the default servlet in an OSP webapp was causing problems for someone and that they were able to eliminate it with no problem.  

Is there a secret here that allows most URL patterns to reach the servlet but a few to serve things statically from the war? 

Thanks.

Jim  


More information about the sakai-dev mailing list