*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes EL function with parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "EL function with parameter" Watch "EL function with parameter" New topic
Author

EL function with parameter

Amit Sharma
Ranch Hand

Joined: Nov 22, 2005
Posts: 87
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>


Amit Sharma SCJP 1.4, SCWCD 5, OCUP-100(UML)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

"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.


[My Blog]
All roads lead to JavaRanch
Amit Sharma
Ranch Hand

Joined: Nov 22, 2005
Posts: 87
I have changed "Amit" to "Amit Sharma"
Sunny Jain
Ranch Hand

Joined: Jul 23, 2007
Posts: 433

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>


Thanks and Regards,
SCJP 1.5 (90%), SCWCD 1.5 (85%), The Jovial Java, java.util.concurrent tutorial
 
 
subject: EL function with parameter
 
Similar Threads
Problem While using EL
problem with EL functions
Trying to use custom actions in jsp - unexpected output
TLD jsp
Do we have write seperate .tld files for each EL?