You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Gregory J. Grubbs" <bu...@hoochiepep.com> on 2000/10/06 04:24:49 UTC

uri-include calling servlet: problems

Robin's explanations have been most helpful.  I now have one of my servlets being called from an XSP page and returning a reasonable result.  The
solution seems very elegant and flexible to me.

There are however two things which bother me about the solution:

1) To pass the data from my HTML form using the method suggested in the FAQ, I must alter the method from POST to GET, then use code like the
following:
 <util:include-uri>
    <util:href>
       <xsp:expr>"http://localhost/servlet/myServlet?" + request.getQueryString()</xsp:expr>
    </util:href>
 </util:include-uri>

Is there any way to continue using the POST method from forms, avoiding the encoded URL being shown in the browser when the result returns?

2) I want my middleware servlet to return a complete XML response, including a specification of the stylesheet to apply.  But if the servlet
returns the <?xml-stylesheet ... > PI, that PI will include inside the <page> tag... and thus confuse Cocoon, which throws the trace:

org.apache.cocoon.processor.ProcessorException: Could not associate stylesheet to document:  no matching stylesheet for: explorer
 at org.apache.cocoon.processor.xslt.XSLTProcessor.getResource(XSLTProcessor.java, Compiled Code)
 at org.apache.cocoon.processor.xslt.XSLTProcessor.process(XSLTProcessor.java:107)
 at org.apache.cocoon.Engine.handle(Engine.java, Compiled Code)
 at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
 at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java, Compiled Code)
 at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java, Compiled Code)
 at java.lang.Thread.run(Thread.java, Compiled Code)

Is there any clever way of applying a stylesheet specified by the servlet's return value?