You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Bip Thelin <bi...@razorfish.com> on 2001/03/01 03:41:00 UTC

[Tomcat 4.x] SSI package

Attatched is a _very_ early release of the SSI package. It's just the initial framework
and one working SSI command 'fsize' which returns a file's size. Looks like this:
'<!--#fsize virtual="/tomcat.gif"-->' I appologize for the
path in the Zipfile, for some reason Winzip screwed up my path. Anyway this is how the
file layout should look like once deployed.
<catalina>
      \
        - servlets / SsiInvokerServlet.java
      |
       \
         - util / ssi /
                        SsiCommand.java
                        SsiConfig.java
                        SsiEcho.java
                        SsiExec.java
                        SsiFlastmod.java
                        SsiFsize.java
                        SsiInclude.java

To try it out map e.g "*.shtml" to the SsiInvoker in web.xml.
---------------------------------------8<-------------------------------------
	<!-- The SSI invoker servlet -->
	<servlet>
		<servlet-name>ssi</servlet-name>
		<servlet-class>org.apache.catalina.servlets.SsiInvokerServlet</servlet-class>
		<init-param>
			<param-name>debug</param-name>
			<param-value>1</param-value>
		</init-param>
		<load-on-startup>5</load-on-startup>
	</servlet>

	<!-- The mapping for the SSI servlet -->
	<!-- Comment this out if you do not want "jsp" service -->
	<servlet-mapping>
		<servlet-name>ssi</servlet-name>
		<url-pattern>*.shtml</url-pattern>
	</servlet-mapping>
---------------------------------------8<-------------------------------------

I'd love constructive critic on design issues as well as eventual performance issues or bugs.
I'll try and finish the other ones soon and have the whole package up to a "final/production" status.

	..bip

Re: [Tomcat 4.x] SSI package

Posted by Remy Maucherat <re...@apache.org>.
> Attatched is a _very_ early release of the SSI package. It's just the
initial framework
> and one working SSI command 'fsize' which returns a file's size. Looks
like this:
> '<!--#fsize virtual="/tomcat.gif"-->' I appologize for the
> path in the Zipfile, for some reason Winzip screwed up my path. Anyway
this is how the
> file layout should look like once deployed.
> <catalina>
>       \
>         - servlets / SsiInvokerServlet.java
>       |
>        \
>          - util / ssi /
>                         SsiCommand.java
>                         SsiConfig.java
>                         SsiEcho.java
>                         SsiExec.java
>                         SsiFlastmod.java
>                         SsiFsize.java
>                         SsiInclude.java

That looks good :-)

Note : You don't need to use the Resources to access the content length. I
suggest using
ServletContext.getResource(path).openConnection().getContentLength()
instead.
To access content, you should use ServletContext.getResourceAsStream(path).

Remy