Results 1 to 2 of 2
Thread: Error in EL function
- 05-21-2012, 10:55 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 42
- Rep Power
- 0
Error in EL function
Hi,
i am trying to run some EL function. but i am getting this error
my jsp file is:-
Java Code:<@ taglib perfix="taglib_test" uri="first_tld.tld" %> <html> <body> ${taglib_test:test_name()} </body> </html>
and function class in WEB-INF/classes/EL1/test1_class.class:-
and my tld file in (WEB-INF/tags/first_tld.tld) :-Java Code:package El1; public class test1_class { public static int first_fun() { return 10; } }
my web.xml is :-Java Code:<?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 http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd" version="2.5"> <tlib-version>2.0</tlib-version> <uri>first_tld.tld</uri> <function> <name>test_name</name> <function-class>EL1.test1_class</function-class> <function-signature> int first_fun() </function-signature> </function> </taglib>
i am getting this error at startup of tomcat:-Java Code:<?xml version="1.0" encoding="ISO-8859-1"?> <web-app 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 http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd" version="2.5"> <taglib> <taglib-uri> first_tld.tld </taglib-uri> <taglib-location> /WEB-INF/tags/first_tld.tld </taglib-location> </taglib> </web-app>
and when i remove web.xml file that time tomcat get started but i get below error in jsp page :-Java Code:SEVERE: Begin event threw exception java.lang.IllegalArgumentException: taglib definition not consistent with specif ication version at org.apache.catalina.startup.TaglibLocationRule.begin(WebRuleSet.java: 1164) at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1 276) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startEle ment(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp l.scanStartElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp l$FragmentContentDriver.next(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(U nknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImp l.scanDocument(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.IllegalArgumentException: taglib definition not consistent with specification version at org.apache.catalina.startup.TaglibLocationRule.begin(WebRuleSet.java: 1164) at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1 276) ... 30 more
someone please help me to solve it....Java Code:exception org.apache.jasper.JasperException: /test.jsp (line: 5, column: 2) The attribute prefix taglib_test does not correspond to any imported tag library org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:149) org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1536) org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:137)
Thanks
Anchit
- 05-31-2012, 09:04 AM #2
Member
- Join Date
- Mar 2012
- Posts
- 41
- Rep Power
- 0
Re: Error in EL function
WEB-INF/tags/first_tld.tld
should be
WEB-INF/first_tld.tld
you don't store .tld in /tags/(its for .tag) or the uri would be
/tags/first_tld.tld
if this operates ok its up to you, but another problem also may be the _ underscore character in XML names (I don't recall whether thats valid).
I avoid a lot of stranger stuff just to keep it simple.
Similar Threads
-
Error using the LWJGL Display function.
By bakerg in forum New To JavaReplies: 0Last Post: 02-15-2012, 03:51 PM -
Help with Square root function and Overload(calc error)
By racingoutbac in forum New To JavaReplies: 3Last Post: 11-04-2010, 12:09 AM -
Error when loading unix shared library with function System.loadLibrary()
By cartoon_20 in forum Advanced JavaReplies: 0Last Post: 04-28-2010, 12:32 PM -
function call error
By peter_thm in forum New To JavaReplies: 2Last Post: 01-13-2010, 12:57 PM -
Possible? Callback function passed as arguments to another function
By TreyAU21 in forum Advanced JavaReplies: 3Last Post: 12-04-2009, 03:08 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks