A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Certification
»
Web Component Certification (SCWCD/OCPJWCD)
Author
EL Function undefined Error
Mohit G Gupta
Ranch Hand
Joined: May 18, 2010
Posts: 634
I like...
posted
Oct 09, 2011 09:41:41
0
Head First
Servlets
and
JSP
2nd edition
pg-393
El.tld inside WEB-INF
SIgn.jsp
EL.DiceRoller
TLD
<?xml version="1.0" encoding="ISO-8859-1" ?> <taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd" version="2.0"> <tlib-version>1.2</tlib-version> <uri>DiceFunctions</uri> <function> <name>rollIt</name> <function-class>EL.DiceRoller</function-class> <funtion-signature> int rollDice() </funtion-signature> </function> </taglib>
The class with Function
package EL; public class DiceRoller { public static int rollDice(){ return (int)((Math.random()*6)+1); } }
JSP
<%@ taglib prefix="mine" uri="DiceFunctions" %> <html><body> ${mine:rollIt()} </body></html>
Error:
The function mine:rollIt is undefined
I am unable to use EL function.
please help in solving the problem
OCPJP 6.0 93%
OCPJWCD 5.0 98%
Niiraj Patel
Ranch Hand
Joined: Sep 17, 2011
Posts: 34
posted
Oct 09, 2011 10:24:43
0
The function mine:rollIt is undefined
The function-signature tag of TLD has typo mistake. Notice the <funtion-signature> instead of <function-signature>.
use this :
<function-signature>int rollDice()</function-signature>
While preparing for exam, the best practice is the Notepad.
Please manually compile and deploy classes.
Regards,
Niraj
Mohit G Gupta
Ranch Hand
Joined: May 18, 2010
Posts: 634
I like...
posted
Oct 09, 2011 12:56:08
0
i did a terrible mistake
thanks for help
Mohit G Gupta
Ranch Hand
Joined: May 18, 2010
Posts: 634
I like...
posted
Oct 09, 2011 12:58:02
0
i did a terrible mistake
thanks for help
I agree. Here's the link:
http://aspose.com/file-tools
subject: EL Function undefined Error
Similar Threads
TLD file
Regarding TLD
cannot find tag library descryptor error
EL syntax error
Issue running TLD
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter