Re: parse all .html as .shtml

> On Mon, 2 Jun 1997, Joseph M. Futrelle wrote:
> 
> > Use the extensions template editor to delete the template for "html".
> > Re-create it but use the class "w3c.jigsaw.ssi.SSIResource" instead
> > of "w3c.jigsaw.resources.FileResource".
> > 
> > The reason not to do this is that unless every single html document on
> > your server contains SSI commands, the server will do some
> > time-consuming parsing unnecessarily.
> 
> Why not have a name space configuration for handling the different
> document types like text (shtml, html), audio(realaudio),
> application(cgi), etc. instead of changing the resources,
> SSIResource from FileResource?

Well, that's what the extensions template is.

FileResource only implements the behavior of reading a file and
sending it to the client, unaltered, in the entity body of an HTTP
reply. Since executing a CGI script or parsing SSI commands, for
instance, are very different kinds of behavior, they're implemented in
other subclasses of HTTPResource, namely w3c.jigsaw.forms.CgiResource
and w3c.jigsaw.ssi.SSIResource. The template for an extension
specifies the resource class *and* its default attributes.

That way, you can also for instance create different FileResource
templates for different content-types. For instance if you want .doc
files to be sent as application/msword and .jpg files to be sent as
image/jpeg, create FileResource templates for both of them and modify
their content-type attributes appropriately.

-- 
Joe Futrelle
Developer, Joule/Jigsaw Java/HTTP
National Center for Supercomputing Applications
futrelle@ncsa.uiuc.edu
(217) 265-0296

Received on Friday, 13 June 1997 12:22:43 UTC