tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Miller <bruce.mil...@nist.gov>
Subject Content negotiation, getMimeType
Date Mon, 08 May 2006 13:06:58 GMT
Hello again;
  My app needs a custom content negotiation where URI's
that correspond to xml (but without explicit extension)
are XSLT'd to html or xhtml (custom since I need browser
sniffing to decide about MathML).  I'll also be dealing
with pre-built pages and caching.

I gather from the list archives that there is no built-in
content negotiation that I can hook into, and that filters
are the way to go.   That's easy enough, but I don't see
how to write a url-pattern that matches _missing_ extension,
so I guess I should filter _everything_.

I can easily check for an existing static xml file,
but if it's not found, I need to handle the following cases:
  * servlets: chain, capturing the output, and if we
    get XML, transform it.
  * images, other static types; preferably by redirect(?)
    to get clean/fast/cachable processing.
I'd _really_ like to avoid extra processing in the last
case, but how do I recognize them? By using
servletcontext.getMimeType(file) ?

I seem to be sliding (again :>) into using File based
approaches rather than resources, so I'm not sure if
things will work in .war.  Also, this seems to move
the mappings out of web.xml and into the code.

So, questions are: do I make sense? Is this a sane approach?
What am I missing?

And, again, thanks in advance!
-- 
bruce.miller@nist.gov
http://math.nist.gov/~BMiller/

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


Mime
View raw message