Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URI in directive <%@ taglib %>

 
Bruno Carneiro
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey folks!

I'm a little bit confused about the attribute "URI" in the directive taglib.
1) Does it a location of the tld?
2) Does the tld need to have the same URI of the directive's URI?
3) When it is like a url, does it get the tld from the specified website?

For me the answers for this questions are: 1) NO 2) YES 3) NO
But, i read that sometimes the container looks the directive's uri and try to get the tld in the uri path. When the tld is not there, the container looks inside of the web.xml, the declaration of the taglib that has that exactly uri, and now it knows where to find the tld. Is that true?
Could someone explain what the container does to find the tld?

Thanks a lot!
Regards
 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
uri element in tld is optional. if taglib uri does not match with any of the uri's defined in tlds, container takes uri specified in taglib as path and tries to locate tld.


 
Bruno Carneiro
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not it. I'm talking about the attribute URI, inside the taglib directive,NOT the tagdir attribute.

<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>

Like this example above. What will be done?

The container will get this uri and will look for a tld in this path? Or it will look for any tld with this URI and use it?
 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i modified the post. that was a typo. is it clear now?
 
Bruno Carneiro
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yeah!
It's clear now!!! Thanks for your help!
One more thing: This rule is applied even if the URI is a website?
 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
even though uri value is a valid website link, (like the one for custom tags which goes to sun site) for container it is a unique name that represents tld or path to tld.
 
Bruno Carneiro
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok! Thanks a lot vani!
I appreciated!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic