Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Taglib newbie question

 
Raghav Sam
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i am new to taglibs. i am a bit confused as what configs i have to do to make my taglib work. i've written the tag support class and put it under "Web-inf/classes...". i've put the jsp page under "webapps". and the taglib descriptor (taglib.tld) in the "Meta-inf" folder. i am not sure what should be the taglib uri, if my context path is "/test..".
for eg:- the jsp page is accessed as, http://localhost:800/test/TestTaglibs.jsp

and i've given the taglib uri as
<%@ taglib uri="http://localhost:800/test/taglib.tld" prefix="test" %>

tomcat throws the following error:

can anyone help?

------------------
Raghav.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
....
jsp page under "webapps". and the taglib descriptor (taglib.tld) in the "Meta-inf" folder. i am not sure what should be the taglib uri, if my context path is "/test..".

if your context is "/test" why is your jsp in the "webapps"
folder?
could you give us some more of your background with tomcat.
regds.
- satya
 
Raghav Sam
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Madhav Lakkapragada:
[b]....
jsp page under "webapps". and the taglib descriptor (taglib.tld) in the "Meta-inf" folder. i am not sure what should be the taglib uri, if my context path is "/test..".

if your context is "/test" why is your jsp in the "webapps"
folder?
could you give us some more of your background with tomcat.
regds.
- satya[/B]

hi,
i am sorry. my context path is indeed "/test" and my jsp page resides in this folder only. sure, i have been working quite some time with tomcat.
raghav.
 
Cameron Park
Ranch Hand
Posts: 371
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if it's correct to place taglib.tld in /test/Meta-inf and its uri "http://localhost:800/test/taglib.tld". Try put taglib.tld out of test/Meta-inf and directly under /test. I know it should work if you specify a uri for the taglib.tld in the web.xml, and then use that uri in taglib directive.
 
Raghav Sam
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Cameron Park:
I don't know if it's correct to place taglib.tld in /test/Meta-inf and its uri "http://localhost:800/test/taglib.tld". Try put taglib.tld out of test/Meta-inf and directly under /test. I know it should work if you specify a uri for the taglib.tld in the web.xml, and then use that uri in taglib directive.

it didnt work! can somebody tell what shud the taglib uri be? can u give an example.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Assuming your taglib.tld file can be in the
WEB-INF folder, in your JSP you will do this:

I haven't tested this (I had my tld's in a jar file),
but I am fairly confident about this. Please let us know
if it works (I will try to validate it and re-post if I
am wrong).
HTH.
regds.
- satya
 
Raghav Sam
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Madhav Lakkapragada:
[B]
Assuming your taglib.tld file can be in the
WEB-INF folder, in your JSP you will do this:

I haven't tested this (I had my tld's in a jar file),
but I am fairly confident about this. Please let us know
if it works (I will try to validate it and re-post if I
am wrong).
HTH.
regds.
- satya[/B]

hi satya,
no. it didnt work. am i supposed to configure my web.xml ? i am intrigued by tomcat's error:

how does it check the Meta-inf folder automatically when i have not set it anywhere?
raghav.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raghav:
Sorry.
I will stop second guessing, will do an example and let
you know at the earliest, if no one else has any input...
regds.
- satya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic