You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ni...@blue-c.com on 2001/04/12 16:15:22 UTC
problem with tomcat 3.2.1 and cocoon 1.8.2
Hi !
I have the following problem with the url mapping mechanisms of tomcat
(but I am not sure whether this is not also a cocoon problem).
I want to do the following:
*) process all files that have the extension ".jsp" with the
org.apache.jasper.runtime.JspServlet servlet
except all files in the directory /foo
*) all files in the directory foo (whether the extension is .jsp
or whathever) should be processed by the cocoon servlet.
now I configured my tomcat 3.2.1(I tried the same before with 3.1.1) the
following way:
web.xml snippet in my test context:
<web-app>
<servlet>
<servlet-name>cocoon</servlet-name>
<servlet-class>org.apache.cocoon.Cocoon</servlet-class>
<init-param>
<param-name>properties</param-name>
<param-value>WEB-INF/cocoon.properties</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>cocoon</servlet-name>
<url-pattern>/foo/*</url-pattern>
</servlet-mapping>
</web-app>
the general tomcat web.xml contains the mapping for all .jsp files:
[...]
<servlet>
<servlet-name>
jsp
</servlet-name>
<servlet-class>
org.apache.jasper.runtime.JspServlet
</servlet-class>
<load-on-startup>
-2147483646
</load-on-startup>
</servlet>
[....]
<servlet-mapping>
<servlet-name>
jsp
</servlet-name>
<url-pattern>
*.jsp
</url-pattern>
</servlet-mapping>
[...]
Did I understand the mechanism correctly ??!
The requests seem to be forwarded to the cocoon servlet, but I alwas get
the following exception
org.xml.sax.SAXParseException: The markup in the document following the
root element must be well-formed.
the file is valid xml, the processing stylesheet is found and there is no
other file in the foo directory.
When I try the same with the <url-pattern> directive *.xml, it works all
correctly.
I need to find some criteria for tomcat to distinguish between normal JSPs
and files that should be processed by the cocoon servlet except the file
extension !
Because tomcat is unable to "understand" the content of the files it
processes, the only possibility I found is the location of the files ...
but as explained this didn't work out for me.
any suggestions ?
Thanks in advance,
niko popitsch
Re: problem with tomcat 3.2.1 and cocoon 1.8.2
Posted by Oskar Werewka <ow...@priv4.onet.pl>.
Have you considered another extension,
and mapping it to cocoon?
>Hi !
>
>I have the following problem with the url mapping mechanisms of tomcat
>(but I am not sure whether this is not also a cocoon problem).
>I want to do the following:
> *) process all files that have the extension ".jsp" with the
>org.apache.jasper.runtime.JspServlet servlet
> except all files in the directory /foo
> *) all files in the directory foo (whether the extension is .jsp
>or whathever) should be processed by the cocoon servlet.
>
>now I configured my tomcat 3.2.1(I tried the same before with 3.1.1) the
>following way:
>web.xml snippet in my test context:
>
><web-app>
><servlet>
> <servlet-name>cocoon</servlet-name>
> <servlet-class>org.apache.cocoon.Cocoon</servlet-class>
> <init-param>
> <param-name>properties</param-name>
> <param-value>WEB-INF/cocoon.properties</param-value>
> </init-param>
></servlet>
><servlet-mapping>
> <servlet-name>cocoon</servlet-name>
> <url-pattern>/foo/*</url-pattern>
></servlet-mapping>
></web-app>
>
>the general tomcat web.xml contains the mapping for all .jsp files:
>
>[...]
> <servlet>
> <servlet-name>
> jsp
> </servlet-name>
> <servlet-class>
> org.apache.jasper.runtime.JspServlet
> </servlet-class>
> <load-on-startup>
> -2147483646
> </load-on-startup>
> </servlet>
>[....]
> <servlet-mapping>
> <servlet-name>
> jsp
> </servlet-name>
> <url-pattern>
> *.jsp
> </url-pattern>
> </servlet-mapping>
>[...]
>
>
>Did I understand the mechanism correctly ??!
>
>The requests seem to be forwarded to the cocoon servlet, but I alwas get
>the following exception
>org.xml.sax.SAXParseException: The markup in the document following the
>root element must be well-formed.
>
>the file is valid xml, the processing stylesheet is found and there is no
>other file in the foo directory.
>When I try the same with the <url-pattern> directive *.xml, it works all
>correctly.
>
>I need to find some criteria for tomcat to distinguish between normal JSPs
>and files that should be processed by the cocoon servlet except the file
>extension !
>Because tomcat is unable to "understand" the content of the files it
>processes, the only possibility I found is the location of the files ...
>but as explained this didn't work out for me.
>
>any suggestions ?
>
>Thanks in advance,
> niko popitsch
Pozdrowienia,
Oskar Werewka