• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jstl tlds entry in web.xml

 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have jstl jar files under App-inf/lib folder of Weblogic, and following simple code in test jsp works like charm WITHOUT any entry of core tld in web.xml
question is , is it not mandatory to define tld entry in web.xml?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Praful Thakare wrote: is it not mandatory to define tld entry in web.xml?


No. It is not mandatory -- in fact, it is highly discouraged.
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey Bear, Nice to hear from you.

but if i change the uri from <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> to <%@ taglib uri="WEB-INF/tags/core" prefix="c" %> i get following error msg

Could not parse deployment descriptor: java.io.IOException: cannot resolve 'WEB-INF/tags/core' into a valid tag library
probably occurred due to an error in /lis/test.jsp

.

so now the question is, if not mention in web.xml does app server connect to java.sun.com/jstl/core?

-P

 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would you change it from something valid to something that's invalid? Makes no sense.
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just trying to understand if uri is actually being referred at run time...since other tlds in my existing project have same value WEB-INF/tags/struts.tld for example..
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The URI is not a URL, it is just a name. The fact that it has the same format as a URL does not mean that it addresses anything.

The URI for a TLD is defined within the TLD itself and the container uses that to match up the URI in the taglib directive to the TLD to which it refers. For poorly-formed TLDs that do not have a URI (bad practice), you specify the location of the TLD in relation to the context root.

The JSTL TLDs each have their published URIs and that's what should be used to address them.

For some reason, some people feel the need to remove the TLD files from the JSTL jar, and put them someplace where they can address them. Where this bizarre practice got root, I do not know.
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
waoo, so you mean just having jstl.jar is enough, there is no need to copy the tld files under web-inf/tags?
I got instructions from following forum



How to Install JSTL
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The article is ancient and wrong. It may have been correct when it was written, but is no longer valid.

Do not extract the TLDs. Do not add anything to the web.xml. Just drop the jar file (or files, depending upon version) into WEB-INF/lib and that's it.
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmm..may not valid for jstl 1.0.6 since i don't find any tld file in jstl.jar for this version, i tired deleting c.tld from web-inf and it fails.

Do you ever Sleep Bear?



 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For JSTL 1.0 (are you using Tomcat 4?) you need both jstl.jar and standard .jar. The TLD files are in the latter.

Sleep?
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
using weblogic 8.1 sp4, yes I have standard.jar let me try to put it under Apps-inf, for some reason jstl.jar needs to be there..

 
reply
    Bookmark Topic Watch Topic
  • New Topic