• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL problem  RSS feed

 
alex reznik
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've set up the jstl lib and tld directories under my Web-inf and have included <%@ taglib uri="/Web-inf/tld/c.tld" prefix="c" %> in the jsp file, which is fine. However, when I try to use anything from the <c:... > prefix, i get the following error:Unable to load class org.apache.taglibs.standard.tag.el.core.OutTag
which is in the c.tld file. Any suggestions? Please help
i am using tomcat 4.0.4 on win NT platform
[ July 03, 2002: Message edited by: alex reznik ]
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hhmm... have you added the <taglib> in the web.xml file??
<extracted-from-datetime-doc>
Configuration
Follow these steps to configure your web application with this tag library:
Copy the tag library descriptor file to the /WEB-INF subdirectory of your web application.
Copy the tag library JAR file to the /WEB-INF/lib subdirectory of your web application.
Add a <taglib> element to your web application deployment descriptor in /WEB-INF/web.xml like this:
<taglib>
<taglib-uri>http://jakarta.apache.org/taglibs/datetime-1.0</taglib-uri>
<taglib-location>/WEB-INF/datetime.tld</taglib-location>
</taglib>
</extracted-from-datetime-doc>
maybe you haven't done that...
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you got both jstl.jar and standard.jar in the WEB-INF/lib directory of your web application?
Simon
[ July 04, 2002: Message edited by: Simon Brown ]
 
alex reznik
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I ve done all those steps. In fact, when i installed JSTL on a Win2000 machine, the process took about 30 seconds and all taglibs work fine. I am wondering now if this is a Win NT problem.
 
alex reznik
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one more thing, when i use an absolute uri like http://java.sun.com/jstl/core, the error message changes to "the uri... is not found in web.xml or the jar files supplied with the application" but its definitely described in the web.xml. Again, this is only Win NT problem for me. Ive cleaned up my classpath and path vars just in case, but still no luck...Any suggestions?
 
Shawn Bayern
Author
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by alex reznik:
one more thing, when i use an absolute uri like http://java.sun.com/jstl/core, the error message changes to "the uri... is not found in web.xml or the jar files supplied with the application" but its definitely described in the web.xml. Again, this is only Win NT problem for me. Ive cleaned up my classpath and path vars just in case, but still no luck...Any suggestions?

It is best to use the well-known, absolute URI as published by the JSTL spec -- for instance, as you say, http://java.sun.com/jstl/core. Any JSP 1.2 container should recognize the presence of tablibs whose TLDs exist in META-INF directories of JARs inserted into WEB-INF/lib. Tomcat doesn't do this, however, unless there exists a 'temp' directory at its base (e.g., coordinate with 'webapps', 'work', and so on). Thus, if this directory doesn't exist, you'll need to create it.
There should be no need to define the JSTL tag libraries in web.xml; the configuration that Andreas quoted is for a project from Jakarta Taglibs ("datetime") that is separate from the JSTL implementation that's hosted there.
Hope that helps,
 
alex reznik
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, thanks guys , everything seems to work fine...
except i was only able to run the tags if the jsp's were in the examples folder, and not myApps for example...reading the web.xml and server.xml i did not find anything that would convince me that the configs are any different for these two folders. Any suggestions where i could look to see whats causing the error? its still, the absolute uri...not described...its not even supposed to be described in the web.xml. correct?
not terribly urgent, but just an issue of clarity
 
Shawn Bayern
Author
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by alex reznik:
ok, thanks guys , everything seems to work fine...
except i was only able to run the tags if the jsp's were in the examples folder, and not myApps for example...reading the web.xml and server.xml i did not find anything that would convince me that the configs are any different for these two folders. Any suggestions where i could look to see whats causing the error? its still, the absolute uri...not described...its not even supposed to be described in the web.xml. correct?
not terribly urgent, but just an issue of clarity

You'll need to add jstl.jar, standard.jar, and the other dependencies that come with the Standard Taglib distribution (assuming you're using the Jakarta Taglibs implementation of JSTL and not another one) into your WEB-INF/lib directory for JSTL to work.
 
alex reznik
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
very true, i ve also noticed that web-inf has to be in all caps (WEB-INF) the explorer will not show this under NT or 2000 and will show up as Web-inf everywhere. this can be seen in the command prompt. After this is resolved, everything works fine...now on to SQL question, i will post it under the other topic...jstl sql setDataSource...
 
Rupal Rshah
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I was having the same problem..but added taglib tag in web.xml and it worked...Thanks Andres Gonzalez for the solution
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!