Ho cercato più a lungo di quanto vorrei ammettere per far funzionare JSTL in Eclipse (e in definitiva sotto GAE/J). Ho scaricato Eclipse, l'estensione per Google App Engine per Eclipse e JSTL (http://download.java.net/maven/1/jstl/jars/ - jstl-1.2.jar si trova nella directory WEB-INF \ lib).Quali file JAR sono necessari per Eclipse per utilizzare JSTL in modo che funzioni in definitiva su GAE/J?
Il mio codice è sotto insieme con l'uscita:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<HTML><HEAD><TITLE>Test Page</TITLE></HEAD><BODY>
Test Page
<c:set var="myvar" value="3"/>
</BODY></HTML>
L'errore che ottengo è:
The tag handler class for "c:set" (org.apache.taglibs.standard.tag.rt.core.SetTag) was not found on the Java Build Path
test.jsp
[my app's path and name]
line 8
JSP Problem
Dall'ultimo post su questa pagina non credo che ho bisogno di uno standard. jar (http://forums.sun.com/thread.jspa?threadID=701267) e in ogni caso non sono riuscito a trovarne uno sul sito download.java.com di Oracle insieme al jar jstl.
EDIT 4: ora funziona - Passi:
1) utilizzare la versione di Apache
2) In realtà includere il file jar nel percorso di generazione (tasto destro del mouse il progetto Eclipse e ha colpito Proprietà -> Java Build Path -> Biblioteche -> Aggiungi classe cartella ..., la guerra/WEB-INF/lib non è a quanto pare sul percorso di generazione di default)
3) Aggiungere il file c.tld alla guerra/WEB-INF/TLD
Marchio il tuo aspetto web.xml:
<\?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">
<display-name>JSTLExample</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib>
</jsp-config>
</web-app>
Il test jsp contenuto del file:
<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!-- Taglib -->
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test Apache ServiceMix with JSTL</title>
</head>
<body>
This is a testpage.
<%= "hello" %>
<c:forEach var="i" begin="1" end="10" step="1">
<c:out value="${i}" />
<br />
</c:forEach>
</body>
</html>
Questo è trange: ho lo stesso problema con jstl.jar e se ho scaricato da dove dici che ha funzionato. –