Super Hornet
Super Hornet

Reputation: 2907

Tag Library Definition issue

I just got this :

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

from http://docs.oracle.com/javaee/1.4/tutorial/doc/JSPTags6.html to use in my tld file but during typing Eclipse doesn't recognize child tags (auto complete not working).

instead of above this:

<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-jsptaglibrary_2_0.xsd" version="2.0">

works well. why?

Upvotes: 0

Views: 90

Answers (1)

JB Nizet
JB Nizet

Reputation: 691973

Because the second one uses a correct schemaLocation declaration and the first one doesn't.

The specification for xsi:schemaLocation says:

The schemaLocation attribute value consists of one or more pairs of URI references, separated by white space. The first member of each pair is a namespace name, and the second member of the pair is a hint describing where to find an appropriate schema document for that namespace.

Upvotes: 2

Related Questions