Meaningless Drivel is fun!*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Exception - EL Funtion Example page 389 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 "Exception - EL Funtion Example page 389" Watch "Exception - EL Funtion Example page 389" New topic
Author

Exception - EL Funtion Example page 389

Sushma Sharma
Ranch Hand

Joined: Jun 02, 2005
Posts: 139
Hi, I am trying to test the EL function as specified at page 389 in HFSJ book.
below is my .tld file.

random.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>RandomFunctions</uri>
<function>
<name>random</name>
<function-class>test.Random</function-class>
<function-signature>
int getRandom()
</function-signature>
</function>
</taglib>

-----------------------------------------------------------------------
When I try to run my JSP file, I am getting following exception : should there be any jsp-version tag in tld file?

org.apache.jasper.JasperException: Mandatory TLD element missing or empty: jsp-version
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:411)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:118)
org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:283)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162)
org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

----------------------------------------------------------------

Any help/suggestions are welcome,
Regards,

Sushma
Sushma Sharma
Ranch Hand

Joined: Jun 02, 2005
Posts: 139
there was a > at the second line, which caused the problem...
anyways, thanks
AmitKumar Jain
Ranch Hand

Joined: Jun 13, 2005
Posts: 95
Your problem is solved but I would like to add that <jsp-version> tag was used in tlds in JSP v1.2. In jsp 2.0 , it has been denoted by version attribute of taglib tag.


SCJP 1.4 : 91%
SCWCD 1.4 : 95%
SCBCD 1.3 : 95%
SCJP 6 Upgrade : 95%
Next SCBCD 1.5
Man is not finished when he is defeated. He is finished when he quits.
 
Don't get me started about those stupid light bulbs.
 
subject: Exception - EL Funtion Example page 389
 
Similar Threads
problem with EL functions
problem with TLD files
how to get .tld file working
Not being able to locate TLD file?
.tld error