Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Trouble getting SSI to work
Trouble getting SSI to work [message #557527] Wed, 08 September 2010 00:48 Go to next message
jeffo  is currently offline jeffo Friend
Messages: 2
Registered: September 2010
Junior Member
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

Re: Trouble getting SSI to work [message #557662 is a reply to message #557527] Wed, 08 September 2010 13:00 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1313
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
Re: Trouble getting SSI to work [message #557685 is a reply to message #557662] Wed, 08 September 2010 14:05 Go to previous messageGo to next message
jeffo  is currently offline jeffo Friend
Messages: 2
Registered: September 2010
Junior Member
I've modified these as well.
Re: Trouble getting SSI to work [message #557745 is a reply to message #557685] Wed, 08 September 2010 16:38 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1313
Registered: July 2009
Senior Member
On 9/8/2010 10:05 AM, jeffo wrote:
> I've modified these as well.

It has been a long time since I've messed with getting SSI to work. Do
these configuration changes work outside of Eclipse in the actual Tomcat
installation? If not, you might want to ask on the Tomcat Users mailing
list.

Cheers,
Larry
Previous Topic:Context Root ignored?
Next Topic:Soap 1.2 Binding "unsupported" in WS Explorer...what have I done wrong?
Goto Forum:
  


Current Time: Fri Dec 19 10:06:06 GMT 2014

Powered by FUDForum. Page generated in 0.03287 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software