File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes tld file error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "tld file error" Watch "tld file error" New topic
Author

tld file error

Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026


Error saying

schemaLocation value must have even number of URI's

I have included the taglib directive along with prefix and uri attributes in Jsp page. And have coded the DiceRoller class too.


Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1029
>schemaLocation value must have even number of URI's
Seems straightforward enough.

Your schemaLocation is currently:
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"

There is only one URI in that, and it says it needs two.
Try this one (copied and pasted from the JSTL c.tld)

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"

Cheers,
evnafets
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Thanks Stefan Evans. But I already tried with that too. It is giving a new error saying

cvc-complex-type.2.4.a: Invalid content was found starting with element 'uri'. One of '{"http://jaav.sun.com/xml/ns/j2ee":short-name}' is expected

at the element

<uri>OutFunction</uri>

I am using Tomcat 5.5.9 and MyEclipse IDE 3.8.4 version. It supports EL
I tried even by including JSTL 1.1 libraries. But still no use.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

Sounds like you are missing the short name element.

Here is the skeleton for JSP 2.0 tld files that I use:



Of course, I replace the "whatever" instances with appropriate text.
[ October 06, 2005: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026
Thanks Bear Bibeault. Afterr including </short-name> element there was no error and got the desired result.

But I like to know whats the purpose of this element.
[ October 10, 2005: Message edited by: vishnu prakash ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61769
    
  67

The comments in the schema file say:

short-name a simple default short name that could be
used by a JSP authoring tool to create
names with a mnemonic value; for example,
the it may be used as the prefered prefix
value in taglib directives
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: tld file error