帮忙看一下c:out标签的问题
一个很简单的jsp,有这样两行:
<c:set var= "userName " value= "wang " />
<c:out value= "${userName} " />
结果在访问这个jsp的时候,出现错误 <c:out> 这行出的错,提示:
According to TLD or attribute directive in tag file, attribute value does not accept any expressions
------解决方案-------------------- <c:set var= "userName " value= "wang " />
直接输出${userName}
------解决方案--------------------lz的代码没有问题。
<%@ page language= "java " import= "java.util.* " pageEncoding= "ISO-8859-1 "%>
<%@taglib uri= "http://java.sun.com/jsp/jstl/core " prefix= "c " %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN ">
<html>
<head>
<title> My JSP 'a.jsp ' starting page </title>
</head>
<body>
<c:set var= "userName " value= "wang " />
<c:out value= "${userName} " />
</body>
</html>
页面输出:wang