struts2中EL表达式

来源:互联网 发布:4g初级网络优化工程师 编辑:程序博客网 时间:2024/06/05 18:47
今天用struts2开发一个网上文件管理系统,由于是刚学完struts2,所以做个项目来练练手。在项目配置好后,进行登录测试时,发现页面刷不出来,500错误
 /index.jsp(14,4) According to TLD or attribute directive in tag file, attribute action does not accept any expressions

定位到14行
<body>      <s:fielderror/>  <s:form action="${pageContext.request.contextPath}/user/login.action" method="post">  用户名:<s:textfield name="user.username"/><br/>  密     码:<s:password name="user.password"/><br/>  <s:submit value="登录"/>  </s:form>  </body>

原来是EL表达式的问题,到网上搜500错误,都是讲什么JSTL版本的问题。原来我做的项目都没有问题,为什么现在就有问题了呢?于是想到我用了struts2标签,action里面不用绝对路径,直接指定action的路径就可以了,删除EL表达式,搞定!