J'ai la classe A:Comment utiliser <c: out value = ...> taglib
package a;
public class A {
private int x = 9;
public int getX() {
return x;
}
}
et le fichier ajsp.jsp:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<jsp:useBean id = "a" class = "a.A" />
<c:out value = "${a.x}" />
</body>
</html>
quand je le lance, il donne une erreur:
- org.apache.jasper.JasperException: /ajsp.jsp(11,0) PWC6236: Selon TLD ou directive attribut dans le fichier d'étiquette, valeur de l'attribut n'accepte pas toutes les expressions
si au lieu de <c:out value = "${a.x}" />
j'utilise <jsp:getProperty property="x" name="a"/>
ça va parfait. Alors, quel est le problème? Merci avance.
version du taglib jstl utilisez-vous? – mdma