in netbeans 7 and jdk 7 and everything is working fine without any changes i made in my environment the old tags are working fine of jstl ${class.get_name()}
${page.getTitle()}
the new once i introduce does not work, and i don’t know why ?
see this simple application example i created added jstl 1.2 into the libraries
and still it does not work?
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
<%
String var1;
var1 = "Welcome";
%>
normal : <%=var1%>
<hr />
dollar: ${var1}
</body>
</html>
First of all, the above page doesn’t even use the JSTL. It uses the JSP EL.
And I assume you expect to see
dollar: "Welcome"printed, but that won’t happen, because the JSP EL doesn’t print values of local variables. It prints the value of attributes.Change your code to
or, better, to
and you’ll see the expected output.