Hi,

Thanks for your response. It runs well now.
I've just changed the type of the returned value in
public static String get_fac(String number) to public static long
get_fac(String number) because it returns a long value.

Regards,
Cyril.
_______________________________

Cyril Vidal
Email: [EMAIL PROTECTED]
Web: http://www.planetexml.com
----- Original Message -----
From: "Nils Leßmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 31, 2002 2:16 PM
Subject: AW: xsp + parameters


Hi,

have a look in the generated java file (search for factoriel_xsp.java),
that's usually the fastest way to see what's really going on.

Anyway, I'd suggest using a second method

public static String get_fac(String number) {
  try {
    long l = Long.parseLong(number);
    return fac(l);
  } catch (NumberFormatException e) {
    return number+" not a number";
  }
}

and calling this from the xsp.

Nils


-----Ursprüngliche Nachricht-----
Von: cyril vidal [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 31. Dezember 2002 11:08
An: [EMAIL PROTECTED]
Betreff: Re: xsp + parameters


So, I've tried the following code, in the aim to convert String to long:
 <factorial-calcul>result:
<xsp:expr>fac(java:lang.Long.parseLong(<xsp-request:get-parameter
 name="number" default="0"/>))</xsp:expr></factorial-calcul>

but it doesn't run:
Error compiling factoriel_xsp: Line 127, column 57: ')' expected. Line
0,
column 0: 1 error



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to