-
1. Re: Cannot get JSTL tags to print variable values.
robr Mar 18, 2005 10:26 AM (in response to robr)I don't have the code with me right now. I will post it tonight.
-
2. Re: Cannot get JSTL tags to print variable values.
robr Mar 23, 2005 1:39 PM (in response to robr)I solved the problem or I should say a really great customer support rep at Jet Brains and another support person at http://www.fuhrer.com/en/jbossplugin/.
The problem was that when I had set up my web module I had configured it to use version 2.3. Version 2.3 does not support JSTL tags. If you try to use them the data will be passed right through like it is a string.
Basically I removed the web module and then readded it using version 2.4.
My web.xml file now looks like the following.<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" 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" > <servlet> <servlet-name>HelloServlet</servlet-name> <servlet-class>com.dynix.webquotes.examples.HelloServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>HelloServlet</servlet-name> <url-pattern>/greeting</url-pattern> </servlet-mapping> <ejb-ref> <ejb-ref-name>ejb/hello</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>com.dynix.webquote.HelloHome</home> <remote>com.dynix.webquote.Hello</remote> </ejb-ref> </web-app>
My JSTLExample.jsp files looks like this.<%-- Created by IntelliJ IDEA. User: rb Date: Mar 23, 2005 Time: 10:37:55 AM To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%! String[] names = {"Ruth", "Matilda", "Millicent", "Micah"}; %> <html> <head><title>JSTL example</title></head> <body> <c:forEach var="person" items="<%= names %>"> <c:out value="${person}" /> </c:forEach> </body> </html>
In the web Modules setting in the Libraries(Classpath) window I have added the following Jar/Directorys. I moved the jar and tld files from JAKARTA 1.1.2 unzipped folder before adding these jar/directory.
D:\projects\webquotes\jstl\lib\jstl.jar
D:\projects\webquotes\jstl\lib\jstl.jar
D:\projects\webquotes\jstl\tld
My project was created in the webquotes folder.
In the Web Module Settings tab of the web Modules window I made the following change under the Modules and Libraries to Package section.
Name Packing Method Relative
jstl.jar Copy files to /WEB-INF/lib/jstl.jar
standard.jar Copy files to /WEB-INF/lib/standard.jar
d:\projects\webquotes\jstl\tld Copy dir to /META-INF/tld
After making these changes the JSTL worked.
I used the following.
Intellij 4.5.4
Jboss 4.01sp1
Latest JBOSS plugin
Java jdk 1.4.2_07 -
3. Re: Cannot get JSTL tags to print variable values.
robr Mar 23, 2005 1:54 PM (in response to robr)I had read somewhere that you did not have to include the tld files in the .war file to use JSTL. I experimented some more and found this to be the case. The only thing I had to do was make sure the standard.jar and jstl.jar files were put into the WEB-INF\lib folder. It is simpler than I thought.