|
Re: Trouble getting SSI to work [message #557662 is a reply to message #557527] |
Wed, 08 September 2010 13:00 |
Larry Isaacs Messages: 1354 Registered: July 2009 |
Senior Member |
|
|
On 9/7/2010 8:49 PM, jeffo wrote:
> Newbie here:
>
> I've followed most of the instructions trying to get SSI working in
> Eclipse. Eventually I want my .jsp files to include other .jsp files, so
> I'm using the filter instead of the the servlet (please correct if
> that's wrong).
>
> I have changed my CATALINA_BASE/conf/context.xml file so it looks like
> this:
> <Context privileged="true">
> <WatchedResource>WEB-INF/web.xml</WatchedResource>
> </Context>
>
> and i've modified my CATALINA_BASE/conf/web.xml to look like this:
>
> <filter>
> <filter-name>ssi</filter-name>
> <filter-class>
> org.apache.catalina.ssi.SSIFilter
> </filter-class>
> <init-param>
> <param-name>contentType</param-name>
> <param-value>text/x-server-parsed-html(;.*)?</param-value>
> </init-param>
> <init-param>
> <param-name>debug</param-name>
> <param-value>0</param-value>
> </init-param>
> <init-param>
> <param-name>expires</param-name>
> <param-value>666</param-value>
> </init-param>
> <init-param>
> <param-name>isVirtualWebappRelative</param-name>
> <param-value>0</param-value>
> </init-param>
> </filter>
>
> <filter-mapping>
> <filter-name>ssi</filter-name>
> <url-pattern>*.shtml</url-pattern>
> </filter-mapping>
>
> finally, i have a basic html file named test.shtml
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> <title>tester</title>
> </head>
> <body>
> hi there
> <!-- #include file="inc.html" -->
> </body>
> </html>
>
> my inc.html text is not included, and when i bring up the page and view
> the source, i get:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> <title>tester</title>
> </head>
> <body>
> hi there
> <!-- #include file="inc.html" -->
> </body>
> </html>
>
> i have left the invoker servlet commented out; not sure if that plays a
> part.
> I'm totally lost here and can't seem to get it working.
>
> Also, there is only one webapp on this server. Not sure if that's relevant.
>
> Thanks,
>
> Jeff
>
>
The "context.xml" and "web.xml" files you need to modify are found under
the Servers project in your workspace. These are the "master" copies
which are published to the Tomcat server prior to start up. For details
about the Tomcat support in WTP, see the WTP Tomcat FAQ[1].
Cheers,
Larry
[1] http://wiki.eclipse.org/WTP_Tomcat_FAQ
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03937 seconds