解决:According to TLD or attribute directive in tag file, attribute value does not accept any express。
来源:互联网 发布:快压软件官方下载 编辑:程序博客网 时间:2024/06/05 09:41
背景:在mysql中有一个字段声明为datetime类型,在用hibernate映射时对应的类型为java.util.Date。因此从数据库中读出来,在前台jsp页面显示时,日期格式为年月日,时分秒,毫秒,例1986:07:26 09:07:21 0。日期在实体类和映射文件中已经声明为java.util.Date类型。
实体类代码:
hibernate关于这两个字段的映射代码:最开始用<s:property value="startTime"></s:property>得出的时间比较怪,是:99-2-26 4:22:50.000
而用el表达式${startTime}得出的时间是1999-02-26 04:22:50.0。
而我想要的时间格式是1999-02-26 04:22:50。
因此用到了jstl标签里的<fmt:formatDate>格式如下:<fmt:formatDate pattern="yyyy:mm:dd HH:mm:ss" value="${startTime}"></fmt:formatDate>
然而报了异常:According to TLD or attribute directive in tag file, attribute value does not accept any expressions
查询之后得到的解决办法有两种:
一、在page指令里,加入isELIgnored="true"属性,即
<%@ page language="java" contentType="text/html;charset=gbk" isELIgnored="true" %>这个是忽略EL表达式,虽然可以解决问题,但其他处的EL表达式会被当做字符串输出,不建议使用。
二、把<%@ taglib prefix="c" uri="http://java.sun.com/jstl/fmt" %>变为:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>
原理(摘抄):应用部署运行的时候出现JSP异常, 发生在使用JSTL库的时候: According to TLD or attribute directive in tag file, attribute value does not accept any expressions,可能是因为使用了JSP2.0版本, 同时又没有使用JSTL core库的备用版本(RT库)。
最终页面首部:
输出时使用:注:startTime代表本案例中使用的字段名。
用到的JSTL的jar包:jstl.jar和jstl-standard.jar。下载地址:http://jarfiles.pandaidea.com/。
- According to TLD or attribute directive in tag file, attribute value does not accept any express
- 解决:According to TLD or attribute directive in tag file, attribute value does not accept any express。
- 解决:According to TLD or attribute directive in tag file, attribute value does not accept any express。
- 解决:According to TLD or attribute directive in tag file, attribute value does not accept any express。
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- According to TLD or attribute directive in tag file, attribute value does not accept any expressions
- 程序员该有的艺术气质—SOLID原则
- springmvc接收复杂类型的json数据需要注意的地方
- [FC][全屏击杀修改教程]
- CentOS 6.7安装Oracle 11gR2图文教程
- 每天一个linux命令(28):tar命令
- 解决:According to TLD or attribute directive in tag file, attribute value does not accept any express。
- Easyui-DataGrid纵向合并单元格(根据某列合并)
- 日期格式国际化
- [FC][移动速度修改教程]
- Python 中文编码
- 377. Combination Sum IV
- 每天一个linux命令(29):chgrp命令
- 实现Action的三种方式(四)
- [FC][子弹数修改教程]