Forums Register Login

Problem accessing the standard tag lib.

+Pie Number of slices to send: Send
Hi

I'm absolutely new to JSP and I'm struggelig to get some example programs running.
I use Tomcat 6.0.18 with Firefox 3.0.7. I've loaded the standard taglibs from the Sun site into C:\Java\jakarta-taglibs-standard-1.1.2\lib
and placed the two *.jar files on my CLASSPATH:
CLASSPATH=C:\Java\jakarta-taglibs-standard-1.1.2\lib\jstl.jar;C:\Java\jakarta-taglibs-standard-1.1.2\lib\standard.jar

The first line af my *.jsp file reads:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

When I run it I get a dump:
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

What am I doing wrong?

Thanks in advance.

PotAsh
+Pie Number of slices to send: Send

Hi Egi ,

Welcome to Javaranch .

For JSTL 1.1 use <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Check out this for details Javaranch FAQ
+Pie Number of slices to send: Send
 

Balu Sadhasivam wrote:
Hi Egi ,

Welcome to Javaranch .

For JSTL 1.1 use <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Check out this for details Javaranch FAQ



Thank you for your welcome.
I did as directed, but the result is still the same. A stack dump.
+Pie Number of slices to send: Send


Egil,

Did you read that link completely. Tomcat 6 uses JSP2.1 complaint container, so i guess you should use JSTL 1.2 as directed in the link.
+Pie Number of slices to send: Send
You need to put it in the webapp's classpath, not the CLASSPATH environment variable. The CLASSPATH environment variable is only used when you manually execute javac.exe or java.exe without the -cp, -classpath or -jar arguments.

The webapp's default classpath covers the /WEB-INF/lib. Place the webapp related JAR files in there.
+Pie Number of slices to send: Send
I downloaded the jstl-1.2.jar file and placed it in the /WEB-INF/lib folder.

C:\Tomcat 6.0\webapps\RequestHeaders\WEB-INF\lib

<DIR> .
<DIR> ..
414.240 jstl-1.2.jar
16.905 jstl.jar
293.750 standard.jar
3 fil(er) 724.895 byte

Also I changed the taglib directive like this
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl-1.2/core" %>

Same result: Stack dump.

+Pie Number of slices to send: Send
The upgrade is not needed, the taglib URI is completely wrong and you forgot to remove the standard.jar.

Please read the aforementioned JSP FAQ.
+Pie Number of slices to send: Send
There is a space in the directory name where tomcat is installed: C:\Tomcat 6.0
Could that be a problem?

+Pie Number of slices to send: Send
OK, I give up.
+Pie Number of slices to send: Send


There is a space in the directory name where tomcat is installed: C:\Tomcat 6.0
Could that be a problem?



That shouldnt be a problem. OK do the whole exercise again . just adding only the required jar files(jstl1.2) to CLASSPATH and as well as in the lib directory. ( remove old jars)

Also as Bauke mentioned URI is wrong and use the one from FAQ
+Pie Number of slices to send: Send
No, there is no "as well as". The CLASSPATH environment variable is completely ignored by the appserver.

Read the JSP FAQ. Clearly ignoring it won't generate helpful answers from my side.
+Pie Number of slices to send: Send
 

Bauke Scholtz wrote:The upgrade is not needed, the taglib URI is completely wrong and you forgot to remove the standard.jar.

Please read the aforementioned JSP FAQ.



Hi.
I installed the jstl-1.2.jar file and removed the other two.
It still does not work. In what way is the URI wrong? I see no directions in the FAQ regarding JSTL.1.2.

rgds.
PotAsh
+Pie Number of slices to send: Send
 



Hi.
I installed the jstl-1.2.jar file and removed the other two.
It still does not work. In what way is the URI wrong? I see no directions in the FAQ regarding JSTL.1.2.

rgds.
PotAsh



Post the recent error. and URI used.
+Pie Number of slices to send: Send
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl-1.2/core" %>

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl-1.2/core cannot be resolved in either web.xml or the jar files deployed with this application

+Pie Number of slices to send: Send


<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl-1.2/core" %>



where jstl-1.2 in URI comes from ? Whats the URI in FAQ , its mere jsp/jstl . check again in FAQ
+Pie Number of slices to send: Send
I see nothing in the FAQ regarding the URI for v.1.2.
If I use the URI specified for v.1.1 (<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>), I get:

org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

Please bear with me. I'm absolutely new to JSP.

rgds
PotAsh
+Pie Number of slices to send: Send
Thank you gentlemen for your kind help.
Now it runs.

I copied the jstl-1.2.jar to jstl.jar and used the URI given for v.1.1.
Then I had to restart the browser. It seems that Firefox does some kind of buffering that interferes with the "logical" workings of the browser.

Rgds.
Egil
+Pie Number of slices to send: Send
I edited this thread to remove all the irrelevant posts about over-riding the CLASSPATH -- what nonsense!
It's a tiny ad. At least, that's what she said.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


Reply locked
This thread has been viewed 2053 times.
Similar Threads
c.tld: (line 2, col -1): Element type "taglib" is not declared?
Error with JSTL tags in eclipse
The absolute uri problem
JSTL URI problem
HFSJ page 437
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:17:49.