cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boris Althaus" <bo...@petra-productions.de>
Subject Re: [XSP] <expr> not for int?
Date Fri, 04 Apr 2003 14:21:10 GMT
The xsp-logic tag is allowed before the page tag too.
But in that section should be declared a class or a method like

String myMethod(){
 return "string";
}

This declared method can used in the page section.

Boris
  ----- Original Message ----- 
  From: Lionel Crine 
  To: cocoon-users@xml.apache.org 
  Sent: Thursday, April 03, 2003 9:10 AM
  Subject: Re: [XSP] <expr> not for int?


  the <xsp:logic> tag should be between the <page> tag.

  Lionel



  At 11:21 02/04/2003 +0200, you wrote:
  >Hello,
  >
  >the following XSP causes an LanguageException:
  >
  ><?xml version="1.0" ?>
  >
  ><xsp:page language="java"
  >  xmlns:xsp="http://apache.org/xsp">
  >
  >  <xsp:logic>
  >   int value = 1;
  >   value = value + 1;
  >  </xsp:logic>
  >
  >  <page>
  >   <title>PageTitle</title>
  >   <content>
  >    1 + 1 = <xsp:expr>value</xsp:expr>
  >   </content>
  >  </page>
  ></xsp:page>
  >
  >The exception says:
  >
  >org.apache.cocoon.components.language.LanguageException: Error compiling
  >xsptest_xsp:
  >Line 69, column 22: <identifier> expected
  >Line 69, column 16: class value not found in class
  >org.apache.cocoon.www.xsptest_xsp
  >Line 0, column 0:
  >2 errors
  >
  >After changing the type from int to String, the XSP works:
  >
  ><?xml version="1.0" ?>
  >
  ><xsp:page language="java"
  >  xmlns:xsp="http://apache.org/xsp">
  >
  >  <xsp:logic>
  >   String value = "1";
  >   value = "2";
  >  </xsp:logic>
  >
  >  <page>
  >   <title>PageTitle</title>
  >   <content>
  >    1 + 1 = <xsp:expr>value</xsp:expr>
  >   </content>
  >  </page>
  ></xsp:page>
  >
  >Why? Doesn't <xsp:expr> automatically convert int to String?
  >
  >Thank you!
  >
  >Regards
  >Stephan
  >
  >
  >
  >---------------------------------------------------------------------
  >To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
  >For additional commands, e-mail: cocoon-users-help@xml.apache.org


  ---------------------------------------------------------------------
  To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
  For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message