On 4/9/2015 3:03 PM, George Sexton wrote:


On 4/9/2015 10:06 AM, Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

George,

On 4/9/15 10:52 AM, George Sexton wrote:
On 4/8/2015 6:15 PM, Leggio, Andrew wrote:
This contains both HTML and JSP.  I would like the HTML to be
handled through Apache and JSP pages to be handled by TOMCAT.
How do I accomplish this?
Just my two cents, but any server that works the way you want is
not compliant with the servlet specification. It states that all
requests for a context must be passed to the container.
??

The servlet spec doesn't apply to environments, only containers. If
the OP wants to have Apache httpd serve static files and proxy dynamic
requests, that's perfectly reasonable.

It's also easy to do.

What you're suggesting is what GoDaddy does. The problem is that if
you map requests for things like css, javascript, or even ".html"
pages to a servlet, then it breaks.

Bad idea.
?

Why would a servlet have a problem handling a request for a .html
file? The DefaultServlet was designed with that explicit purpose in mind

What I'm saying is that having httpd handle request for .html and
everything else handled by the servlet container violates section 4.1 of
Java Servlet Specification 3.0.

The issue is not the servlet handling the request for .html. The issue
is that if the deployment descriptor has an explicit mapping for
/context/foo.html, and the web app is never presented with the request
because it's being done at the higher level of Apache httpd, then it
breaks the web app. httpd is given the request for /context/foo.html,
and there is no corresponding file, and the web app is broken.

You can argue about whether it's smart to map servlets into .html, but
again my reading of the spec is that unequivocally, if the request path
matches a deployed context, the request must be routed to the
context/container.

Then your reading is incorrect. The spec only applies to requests that reach the container in the first place. If something else handles it before it reaches the container, the spec is not applicable.


There are a lot of legitimate reasons to map "static" resources into
servlets. Things like images, graphs, CSS files, Javascript files, etc.

Certainly, and that's what I do. But it's for convenience and ease of configuration, not because it's what the spec requires. Other people have other needs...


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

Reply via email to