You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Hugues Marilleau <hu...@xenon.medisite.net> on 2000/07/06 18:59:50 UTC

Re: XSP + "request" object problem [Part II :)]

On Thu, Jul 06, 2000 at 10:36:26AM -0400, sudhi wrote :
> Hi,
> Put your <xsp:logic> tag inside <page>
> And it will work
> HTH
> Sudhi
> 

Thx, it worked, but only with something like this :

                 String foo_var = request.getParameter ("foo_field");
or :
                 String foo_var = "bar" ;

not :
                private synchronized String myparam ()
                {       
                        // String foo_var = request.getParameter ("foo_field");
                        String foo_var = "bar";
                        return foo_var;
                }
or
                private synchronized String myparam ()
                {
                        // String foo_var = request.getParameter ("foo_field");
                        String foo_var = "bar";
                        return foo_var;
                }

inside the <xsp:logic> tags.

Here is the error page :

                                        Error found handling the request.

    java.lang.Exception: XSP Java Compiler: Compilation failed for _test2.java
    69: '}' expected.
        );
          ^
    71: Statement expected.
                    private synchronized String myparam ()
                    ^
    79: Identifier expected.
          document.createTextNode("\n\n\t")
                                 ^
    3 errors


        at org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJavaProcessor.java
        at org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:451)
        at org.apache.cocoon.Engine.handle(Engine.java:305)
        at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:311)
        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)

Warning: this page has been dynamically generated.

I looked in the _test2.java and see this :

    [...snip...]

    xspCurrentNode.appendChild(
      document.createTextNode("\n        ")
    );                                                                            <-- line 69

                private synchronized String myparam ()                            <-- line 71
                {
                        // String foo_var = request.getParameter ("foo_field");
                        String foo_var = "bar";
                        return foo_var;
                }

    xspCurrentNode.appendChild(
      document.createTextNode("\n\n\t")                                           <-- line 79
    );

    [...snip...]

I see nothing wrong with it, because functions worked when my <xsp:logic> 
</xsp:logic> weren't in my <page> </page> tag, but not anymore now :(


Re: XSP + "request" object problem [Part II :)]

Posted by Hugues Marilleau <hu...@xenon.medisite.net>.
On Thu, Jul 06, 2000 at 01:44:19PM -0400, sudhi wrote :
> Hi...
> If u want to write function then u have put "outside" of <page> tag.
> U can easily understand this, if u look at the java file created out of
> your xsp page.
> Take a look at the java file created by the xsp processor in the
> repository.
> HTH
> Sudhi
> 

Yes I understood why I can't put functions just after the posting.

Thx to you and the other Cocooner who replyed.


Re: XSP + "request" object problem [Part II :)]

Posted by sudhi <su...@insage.com>.
Hi...
If u want to write function then u have put "outside" of <page> tag.
U can easily understand this, if u look at the java file created out of
your xsp page.
Take a look at the java file created by the xsp processor in the
repository.
HTH
Sudhi

Hugues Marilleau wrote:
> 
> On Thu, Jul 06, 2000 at 10:36:26AM -0400, sudhi wrote :
> > Hi,
> > Put your <xsp:logic> tag inside <page>
> > And it will work
> > HTH
> > Sudhi
> >
> 
> Thx, it worked, but only with something like this :
> 
>                  String foo_var = request.getParameter ("foo_field");
> or :
>                  String foo_var = "bar" ;
> 
> not :
>                 private synchronized String myparam ()
>                 {
>                         // String foo_var = request.getParameter ("foo_field");
>                         String foo_var = "bar";
>                         return foo_var;
>                 }
> or
>                 private synchronized String myparam ()
>                 {
>                         // String foo_var = request.getParameter ("foo_field");
>                         String foo_var = "bar";
>                         return foo_var;
>                 }
> 
> inside the <xsp:logic> tags.
> 
> Here is the error page :
> 
>                                         Error found handling the request.
> 
>     java.lang.Exception: XSP Java Compiler: Compilation failed for _test2.java
>     69: '}' expected.
>         );
>           ^
>     71: Statement expected.
>                     private synchronized String myparam ()
>                     ^
>     79: Identifier expected.
>           document.createTextNode("\n\n\t")
>                                  ^
>     3 errors
> 
>         at org.apache.cocoon.processor.xsp.language.java.XSPJavaProcessor.compile(XSPJavaProcessor.java
>         at org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:451)
>         at org.apache.cocoon.Engine.handle(Engine.java:305)
>         at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:311)
>         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)
> 
> Warning: this page has been dynamically generated.
> 
> I looked in the _test2.java and see this :
> 
>     [...snip...]
> 
>     xspCurrentNode.appendChild(
>       document.createTextNode("\n        ")
>     );                                                                            <-- line 69
> 
>                 private synchronized String myparam ()                            <-- line 71
>                 {
>                         // String foo_var = request.getParameter ("foo_field");
>                         String foo_var = "bar";
>                         return foo_var;
>                 }
> 
>     xspCurrentNode.appendChild(
>       document.createTextNode("\n\n\t")                                           <-- line 79
>     );
> 
>     [...snip...]
> 
> I see nothing wrong with it, because functions worked when my <xsp:logic>
> </xsp:logic> weren't in my <page> </page> tag, but not anymore now :(
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org