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 mention tld file in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "mention tld file in jsp" Watch "mention tld file in jsp" New topic
Author

mention tld file in jsp

pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 323

Hello,

I have created a tld file and placed it in WEB-INF/tag folder.

How to mention it in the jsp file ?

I'm writing , but it shows "can not find tag library descriptor for ...." error.

Please advise.


Thanks,
Pramod
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61608
    
  67

Don't use the file path for the URI, use the real URI for the TLD.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 323

Hi Bear,

Below is my .tld file code :-

What will be the uri from the below code which I'll mention in my jsp :-





The file is stored as egdpagination.tld

The below statement in my jsp file uses this tag :-

pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 323

Hey Bear,

I got the solution for this problem.

I kept it as <% ...." /WEB-INF/tags/egdpagination.tld" ....%> , I didn't have any <uri> tag in my tld file and I also mentioned the following code in my web.xml file :-

Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1018
Well thats one way to do it.
But not the best IMO.

The better way is to indicate the URI in the tld with the uri tag: <uri>my.tag.egdpagination</uri>


You can then get rid of the entry in your web.xml file.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61608
    
  67

Stefan Evans wrote:Well thats one way to do it.
But not the best IMO.

I'll go further and say that it's a very poor and fragile way to do it.

Assign a real URI to the TLD as Stefan outlined.
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 323

Thanks Stefan and Bear for your advice.

Regards,
Pramod

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mention tld file in jsp