Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mention tld file in jsp

 
pramod talekar
Ranch Hand
Posts: 366
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65223
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use the file path for the URI, use the real URI for the TLD.
 
pramod talekar
Ranch Hand
Posts: 366
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 366
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1784
10
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65223
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 366
Eclipse IDE Java Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Stefan and Bear for your advice.

Regards,
Pramod

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic