您的位置:首页 > Web前端 > JavaScript

错误:#{...} is not allowed in template text

2014-08-03 16:42 211 查看
今天在编写一个structs的小程序时,突然出现了 #{...} is not allowed in template text这个错误,

部分源码如下<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h1>Article add Login user can access</h1>
登录用户为:#{loginUser }
</body>
</html>错误信息:
org.apache.jasper.JasperException: /WEB-INF/Article/add.jsp (line: 12, column: 8) #{...} is not allowed in template text
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)

查找信息后,在stackfloverflaw网站上,给出了明确的解答
这是原问题链接点击打开链接

原来${...}是jsp的一种标记语言,而#{...}是JSF的一种标记语言,在jsp页面中打印model attribute 必须用${...}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jsp web
相关文章推荐