tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Abramson <>
Subject RE: WML Generation from JSP broken!!!!
Date Thu, 14 Dec 2000 14:32:54 GMT
I don't think it should be done through a server's MIME type mapping -
that means that someone writing a web app needs to know about the
mappings installed on the target server, which makes the web app less

I thought I remember there being similar discussions previously about
how the "types" of various documents need to somehow be declared or
communicated.  There appear to be at least these four:

  * what is a JSP page? (proposal - ends with .jsp?)
  * what is a JSP fragment? (proposal - ends with .jspf?)
  * what is an XML JSP page? (proposal - ends with .jspx?)
  * what is an XML JSP fragment? (proposal - ends with .jspxf?)

The container (or other tools) will need to be able to distinguish
between these for the following situations:

  * it may need to look at every file in the web app and categorize
    them according to type.  For example, a tool that preprocesses
    JSP's into Servlet will need to know what files are actually

  * when presented with a request, the container needs to know if the
    request is for a JSP page or an XML JSP page.  It should also know
    not to serve fragments.

It is important that we come up with a standard way of categorizing
web app documents into the above types.  Examining the contents of the
document is, in my opinion, an awful solution.  Having standard
extensions seems far better.  Another approach is to declare each
document's type in the web.xml, or to declare categorization rules in
web.xml (e.g., XMLJSP == *.[jspx|jsx]), but that seems much clumsier
to me.

Is there anything wrong with going by extension?  I'll bet that's what
a lot of tools are starting to do anyway, so we might as well
standardize it...


On 14 December 2000 (-0000), Miles Sabin <> wrote:

> Tom Reilly wrote,
> > It seems to me there are a couple solutions:
> >
> > 1) look for jsp:root
> > 2) use DOCTYPE
> > 3) based it on file extension
> >
> > I don't like 1 because it adds overhead to the translation 
> > process, and you have to deal with cases like: <%-- jsp:root 
> > --%>
> >
> > I don't like 2 because if your JSP page is generating XML and 
> > you want to output a DOCTYPE then you have a collision.
> >
> > So that leaves 3 which I like the best.  A good standard default 
> > would be "jspx".  Of course most app servers allow this to be 
> > customized.  I also like this because then different filters can 
> > be assigned to JSP pages written in XML and plain old JSP pages.
> Yes and no. I agree that it'd be a mistake to handle this by
> inspecting the contents of the document, but I don't think file
> extensions are quite the right way to go.
> We should do it based on MIME type, and allow servers to use their
> existing file extension to MIME type mapping mechanisms to do the
> rest.
> What is the mime type for an XML-syntax JSP doc?
> application/jsp+xml or text/jsp+xml would seem to be the most
> likely candidates ... presumably they'd need to be registered.
> Cheers,
> Miles
> -- 
> Miles Sabin                               InterX
> Internet Systems Architect                5/6 Glenthorne Mews
> +44 (0)20 8817 4030                       London, W6 0LJ, England

View raw message