JSTL library problems

J

Joey P

Hi,

I've been trying all day to get JSP files working through Tomcat on my
home computer. I'm very new to JSP so don't really know how to do
basic programming in it yet. I copied out some JSP from my workbook
into JPadPro just to see how it would look in Tomcat. The code is
listed below:-

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

<c:set value="Tiddles" var="myCat" />
<c:set var="myDbId" scope="application">jdbc:mysql://localhost/eg02dsdb</c:set>

<html>
<head>
<title> Question 1 </title>
</head>
<body>
<p>
<br />myCat is
<c:eek:ut value="${pageScope.myCat}" default="No myCat object on this
page"/>
<br />myDbId is
<c:eek:ut value="${applicationScope.myDbId}" default="No myDbId object in
this application"/>
</p>
</body>
</html>

I then got an error message when I tried to load the page in Tomcat.
I eventually managed to overcome this problem by deploying the c.tld
file into WEB-INF\tld and the standard.jar and jstl.jar files into the
WEB-INF\lib folder. The page then loaded, but instead of
displaying...

'myCat is Tiddles'
'myDbId is jdbc:mysql://localhost/eg02dsdb'

it displays...

'myCat is ${pageScope.myCat}'
'myDbId is ${applicationScope.myDbId}'

If anyone could help me understand what I'm doing wrong, I'd be very
grateful. Thank you!

Joe P
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top