Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL function with parameter

 
Amit Sharma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am using an EL function with double parameter. but getting exception

"Comma expected for expression language function abc rollDice"


please help me to find where i am wrong.
---------------------------------------------------------------------------
Code-----

Jsp:-

<%@ taglib uri="DiceFunctions" prefix="mine"%>

${mine:rollIt(2)}

---------------------------------------------------------------------------
CLASS:-


package beans;

public class DiceRoller {

public static double rollDice(double i){
return Math.abs(i);
}
}
----------------------------------------------------------------------
TLD:-

<short-name>abc</short-name>
<uri>DiceFunctions</uri>

<function>
<name>rollIt</name>
<function-class>beans.DiceRoller</function-class>
<function-signature>double rollDice(double i)</function-signature>
</function>
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Amit",
You may not be aware of the ranch Naming Policy. Please read it carefully and change your name accordingly (you need to set both first and last names). Thank you.
 
Amit Sharma
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have changed "Amit" to "Amit Sharma"
 
Deepak Chopra
Ranch Hand
Posts: 433
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amit:

TLD:-

<short-name>abc</short-name>
<uri>DiceFunctions</uri>

<function>
<name>rollIt</name>
<function-class>beans.DiceRoller</function-class>
<function-signature>double rollDice(double i)</function-signature>
</function>


change it to:

<function-signature>double rollDice(double)</function-signature>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic