tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anthony Ikeda <anthony.ik...@proxima-tech.com>
Subject RE: unable to open tablibrary
Date Thu, 18 Jan 2001 23:20:13 GMT
Okay quickly,
The <taglib-uri> element has nothing to do with the physical location of the
tld, it's just a url to use when referencing it. So if you set it as:

	<taglib-uri>/Hometag</taglib-uri>
      <taglib-location>
           /WEB-INF/taglib/test-taglib.tld
       </taglib-location>

Each time you reference http://www.yangc.com/Hometag it will know that this
is where the tld is located at and will read the tld file at the
<taglib-location> which in this case is /WEB-INF/taglib/test-taglib.tld.

In other words, /Hometag = /WEB-INF/taglib/test-taglib.tld

If you set up your taglib directive as:

<%@ taglib uri="/Hometag" %>

Then it will reference this file.

You can set up mutliple tag libraries like:

	<taglib>
		<taglib-uri>/shopTag</taglib-uri>
 
<taglib-location>/WEB-INF/taglib/shoppingCart-taglib.tld</taglib-location>
	</taglib>
	<taglib>
		<taglib-uri>/homeTag</taglib-uri>
	
<taglib-location>/WEB-INF/taglib/test-taglib.tld</taglib-location>
	</taglib>
	<taglib>
		<taglib-uri>/adminTags</taglib-uri>
	
<taglib-location>/WEB-INF/taglib/admin-taglib.tld</taglib-location>
	</taglib>

	etc......

Does this clear things up??

Cheers,
Anthony Ikeda,
Web Application Developer,
Proxima Technology,

Level 13,
181 Miller Street,
North Sydney
Australia


PH: +612-9458-1718
Mob: 041 624 5143


> -----Original Message-----
> From: Yang,Chun [mailto:yangc@omrsystems.com]
> Sent: Friday, 19 January 2001 4:31 AM
> To: 'taglibs-user@jakarta.apache.org'
> Subject: unable to open tablibrary
> 
> 
> Hi, I have encountered the following error message when I try 
> to run a jsp
> page with a simple empty bodycontent tag. 
> The error message reads:
> org.apache.jasper.compiler.CompileException:
> D:\chun\testarea\taglib\helloworldtag.jsp(0,0) Unable to open 
> taglibrary
> http://www.yangc.com/taglib/testtags : null 
> The entries for the afore-mentioned taglib in web.xml is:
>     <taglib>
>         <taglib-uri>
>            http://www.yangc.com/taglib/testtags
>         </taglib-uri>
>         <taglib-location>
>            /WEB-INF/taglib/test-taglib.tld
>         </taglib-location>
>     </taglib>
> And the test-taglib.tld which is located in 
> <CONTEXT_ROO>/WEB-INF/taglib has
> the following entry:
>   <tag>
>       <name>hw</name>
>       <tagclass>HelloWorldTag</tagclass>
>       <bodycontent>empty</bodycontent>
>       <info>
>       </info>
>   </tag>      
> And the jsp page is as simple as
> <%@ taglib uri="http://www.yangc.com/taglib/testtags" prefix="foo" %>
> <html>
> <body>
> 
> <foo:hw/>
> 
> <hr>
> 
> </body>
> </html>
> 
> What could poooossibly be wrong ? I read the documentation 
> several times and
> simply couldn't figure this out !
> 
> btw, the environment I am working in is Apache1.3.14(win32) 
> and TomCat3.2.1
> 
> Your help is greatly appreciated!
> 



Mime
View raw message