Struts 1.3.5 & JSTL 1.1

Hello,

I've migrated to Struts 1.3.5 and I can't work with JSTL 1.1.X, when we use fn tag library and other funcionality. JSTL works fine with Struts 1.2.8 but not with 1.3.5. My IDE is Eclipse 3.1, JRE 1.5. and Tomcat 5.5. I put standard and jstl jars in my lib directory as well as c.tld fmt.tld and fm.tld in the WEB-INF folder. Anybody can help me?

For example, I have the following at the begining in one my jsp's:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

<%@ page contentType="text/html; charset=iso-8859-1" language="java"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>

<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>

<%@ taglib uri="/WEB-INF/c.tld" prefix="c"%>

<%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%>

<%@ taglib uri="/WEB-INF/fn.tld" prefix="fn"%>

.....

But instructions like <c:out value='${sessionScope.usuario.nom}' /> prints me ${sessionScope.usuario.nom}, not the value of usuario.nom.

This same example works fine with JSTL 1.0. (with jars jstl-1.0.2.jar and standard-1.0.2.jar).

Anyone can guide me where I'm wrong? Configutarion, validations headers,...?

I've tried with and without

<taglib>

<taglib-uri>/WEB-INF/c.tld</taglib-uri>

<taglib-location>/WEB-INF/c.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/fmt.tld</taglib-uri>

<taglib-location>/WEB-INF/fmt.tld</taglib-location>

</taglib>

<taglib>

<taglib-uri>/WEB-INF/fn.tld</taglib-uri>

<taglib-location>/WEB-INF/fn.tld</taglib-location>

</taglib>

in my web.xml, but the result is the same, I can't make it work.

Any comment will be wellcome.

Thanks in advance,

Joseph from Barcelona.

[2046 byte] By [joenacha] at [2007-11-26 16:33:05]
# 1

You should be using the "well-known" uris to import the tag libraries rather than referring to the tld directly.

ie rather than <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>

it should be <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>

You shouldn't need the tld files anywhere as they are bundled in the appropriate jars.

Depending on whether you are using JSTL1.0 or JSTL1.1 the URI changes.

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

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

Note the subtle addition of the /jsp in there.

Please read [url http://forum.java.sun.com/thread.jspa?threadID=629437&tstart=0] this post (reply#6)[/url] on installing JSTL.

Hope this helps,

evnafets

evnafetsa at 2007-7-8 22:57:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...