jstl 1.1 setting in jsp
i want to use the JSTL 1.1 version.
but writing the following in my JSP leads to error.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
while the ff are fine, but it is the old version`s setting right?
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
any idea?
thanks!
yuubouna
[467 byte] By [
yuubounaa] at [2007-11-26 18:31:57]

# 1
Did you change the servlet version in your web.xml to 2.4? So is this at the top:
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
# 2
Hi,
This is a correct line:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
You should have a file c.tld somewhere in the WEB-INF folder in your web application.
If c.tld file is located in another folder (e.g. my_location) you have to describe this in WEB-INF/web.xml:
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri>
<taglib-location>my_location/c.tld</taglib-location>
</taglib>
</jsp-config>
# 3
>You should have a file c.tld somewhere in the WEB-INF folder in your web application.
No. You shouldn't. It is included in standard.jar
>f c.tld file is located in another folder (e.g. my_location) you have to describe this in WEB-INF/web.xml:
No, you don't.
If you use the standard well-known URI in your JSP page, and the jstl jar files are in your classpath (eg WEB-INF/lib) then it will find the tld bundled in the jar, and use that one.
See my post [url http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0] here (reply #6)[/url] about installation difficulties with Tomcat / JSTL
Cheers,
evnafets
# 4
Thanks a many!
I did the setting in web.xml and tld as written in (reply #6) by evnafets
for JSTL 1.1, like the ff
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
unfortunately, my application didn`t run.
Do I need to change my
servlet-api -> 2.4?
Thanks,
yuubouna
# 5
What server are you using? Tomcat 5?
JSTL1.1 goes with JSP2.0 and will only run on a JSP2.0 container.
If your container is still Servlet2.3/JSP1.2 then you are stuck with JSTL1.0
Can you please be more specific than "my application didn`t run."
Is there an error message? If so what is it?
Show a stack trace please/
Check any logs on your server.
# 6
im using Tomcat 5.5.20
web I added the ff snippet in web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
and in jsp, for JSTL 1.1 core and fmt.
My application unable to run, the login page didnt show.
505 error.
oh btw, any relation with WTP1.5 of eclipse 3.2.1?
Thanks again.
# 7
I figure out what is wrong,
although I change the configuration in my web.xml and be able to set JSTL in 1.1 version, my source code, use the same old pattern of JSTL1.0
like
my original code:
<input type="hidden" value="<c:out value="${resultValue}"/>"/>
if I changed it like the ff, seems fine:
<input type="hidden" value="${resultValue}"/>
new functionality of JSTL 1.1 isn`t it?
Cheers ;-)
yuubouna