cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: util:include-uri pb
Date Fri, 15 Dec 2000 16:17:54 GMT
clongeau@etu.utc.fr (charles longeau) wrote:
>This is the file test.xml:
>
><?xml version="1.0" encoding="ISO-8859-1"?>
>
><?cocoon-process type="xsp"?>
><xsp:page xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>           xmlns:util="http://www.apache.org/1999/XSP/Util">
>

You need a page root tag

<page>

><xsp:logic><![CDATA[
>String param = "";
>Enumeration e = request.getParameterNames();
>   if ((e != null) && (e.hasMoreElements())) {
>     for(int i = 0; e.hasMoreElements() ; i++) {
>       if (i == 0) {
>             param = param + "?";
>       }
>       else {
>             param = param + "&";
>       }
>       String k = (String) e.nextElement();
>       String val = request.getParameter(k);
>       param = param + k + "=" + val;
>    }
>   }
>  ]]>

And I think you could replace all that by request.getQueryString () !!

>
><util:include-uri>
>    <util:href><xsp:expr>"http://myserver.com/chl/cgi-bin/mycgi.cgi" +
>param</xsp:expr></util:href>
></util:include-uri>
>

</page>

></xsp:logic>
>
></xsp:page>
>
>and Cocoon returns me this error :
>
>Error found handling the request.
>
>       java.lang.Exception: XSP Java Compiler: Compilation failed for
>_test.java
>       35: Type expected.
>         if ((e != null) && (e.hasMoreElements())) {
>         ^
>       1 error
>
>
>               at
>org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJavaProcessor.java:141)
>               at
>org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:489)
>               at org.apache.cocoon.Engine.handle(Engine.java:359)
>               at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
>               at 
>javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
>               at
>org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
>               at 
>org.apache.jserv.JServConnection.run(JServConnection.java:188)
>               at java.lang.Thread.run(Thread.java:484)
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


Mime
View raw message