Tomcat 7, Java 7, JSP, Windows XP
Up until now I worked with SSIServlet and everything worked fine. The problem started when I switched to SSIFilter.
It seems that everything is configured properly: The filter is loaded, the Context has the correct privileges, but instead of processing the requests and replace SSI directives with the right file, it just ignores the directives, and in the final output (On the browser) I only get the original directive strings embedded in the HTML code.
Because of an unknown reason, the filter doesn't do its job and doesn't fetch the code from the SSI file.
I believe this is related to the following parameter in the filter's configuration which I left as is (In the web.xml file): (Taken from the documentation)
contentType - A regex pattern that must be matched before SSI processing is applied. When crafting your own pattern, don't forget that a mime content type may be followed by an optional character set in the form "mime/type; charset=set" that you must take into account. Default is "text/x-server-parsed-html(;.*)?".
Or in pure English:
We have concluded that Tomcat isn't complicated enough so we decided to make your life even more miserable.
It would be great if someone could guide me to the solution. I couldn't understand what this parameter stands for and what value should it get.
I don't even know which code to attach:
I haven't changed anything in it when transferred from SSIServlet which worked fine.
This is the web.xml file content. This is the content of the application's file.
The general tomcat's web.xml content is empty. (Left as is)
I removed the comments and unrelated server mappings.
I tried finding a log file that tells if Tomcat encountered any problem but couldn't find any.
That seems right, given the quote in your opening post.
Joined: Sep 30, 2011
Thanks, that worked but partially:
When I set the value to text/x-server-parsed-html(;.*)? or to text/* it didn't work.
The only way I could get the SSIFilter to parse the files is when I set the above value to text/html.
This is good but not enough because by this way I can't get the filter to process JSP files.
I verified that the filter-mappings of the SSIFilter do include the *.jsp pattern.