tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: 404 for JSPs
Date Wed, 23 Dec 2009 16:24:55 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Clay,

On 12/20/2009 9:32 PM, Clay McCoy wrote:
> When I run embedded Tomcat my jsps 404, but my servlets work. When I
> run standard (by putting my war on the Tomcat/webapps directory) my
> servlets 404 but my jsps work (without any css). Can anyone shed some
> light on this? My startup script for embedded is here:
> http://gist.github.com/259737

- From reading all the information you provided, I would guess that, in an
embedded environment, Tomcat does not automatically read conf/web.xml to
configure the default webapps provided by Tomcat (when /not/ running
embedded).

Specifically, you are missing the definition of the JspServlet and the
DefaultServlet. The JspServlet is usually mapped to *.jsp and *.jspx and
(duh) provides JSP capabilities for those URIs. The DefaultServlet is
usually mapped to / (meaning "everything that doesn't match anything
else) and provides the typical plain-old file serving for things like
static content (*.css, etc.).

I suspect that, since you are running in an embedded environment, you
will have to explicitly load these definitions. I'm not familiar enough
with the embedded API to know if you can load more than one web.xml file
for a single Context, but this is essentially what you'll need to do.
You might want to merge conf/web.xml into your webapp's WEB-INF/web.xml
file if you are always going to run your webapp embedded in this way:
you'll save yourself a lot of headache by doing it this way.

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksyRFcACgkQ9CaO5/Lv0PD+nQCgiwmITqPsPm26zgCYKGDeFVkD
u18AoJpwy4d2URYUr5Vtkd3gLJ+oTTJq
=TvQK
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message