aspose file tools*
The moose likes JSP and the fly likes Problem accessing the standard tag lib. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

Problem accessing the standard tag lib.

Egil Hansen
Greenhorn

Joined: Mar 29, 2009
Posts: 8
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
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874


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
Egil Hansen
Greenhorn

Joined: Mar 29, 2009
Posts: 8
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.
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



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.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.
Egil Hansen
Greenhorn

Joined: Mar 29, 2009
Posts: 8
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.

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.
Egil Hansen
Greenhorn

Joined: Mar 29, 2009
Posts: 8
There is a space in the directory name where tomcat is installed: C:\Tomcat 6.0
Could that be a problem?

Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
OK, I give up.
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



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
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
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.
Egil Hansen
Greenhorn

Joined: Mar 29, 2009
Posts: 8
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
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



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.
Egil Hansen
Greenhorn

Joined: Mar 29, 2009
Posts: 8
<%@ 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

Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



<%@ 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
Egil Hansen
Greenhorn

Joined: Mar 29, 2009
Posts: 8
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
Egil Hansen
Greenhorn

Joined: Mar 29, 2009
Posts: 8
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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

I edited this thread to remove all the irrelevant posts about over-riding the CLASSPATH -- what nonsense!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem accessing the standard tag lib.