Works for me. Every mime-type usually lays claim to a default suffix
or two and we should definitely pick one and say that there is an
implicit mapping for that prefix. So if I name my pages jspx then I
don't have to worry about setting any mappings to get a JSP container
to interpret the page as a JSP page written in XML. We should also do
this for regular old JSP itself.
So here's my proposal:
JSP 1.2 engines have mime type mappings like so (or something like
this):
*.jsp -> application/jsp
*.jspx -> application/jsp-xml
And documents of type application/jsp and application/jspx (or
whatever names we decide on) are handled appropriately by default
without any special web.xml constructs.
This will also enable one to author a mime-type based servlet filter
that can operate on JSP pages in a standard way.
Miles Sabin <[EMAIL PROTECTED]> writes:
> 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
> [EMAIL PROTECTED] http://www.interx.com/
--
Tom Reilly
Allaire Corp.
http://www.allaire.com