jstl表达式中的默认日期格式

时间:2013-05-12 13:01:15

标签: java jstl expression

我已经访问过以下帖子:

https://stackoverflow.com/questions/6250585/how-to-set-date-pattern-date-format-for-an-entire-application

https://stackoverflow.com/questions/281380/format-date-with-fmtformatdate-jsp

我是否有办法以某种方式定义默认日期格式..所以我不需要格式化为整个应用程序。

我的意思是我不想一次又一次地使用格式化程序......有什么想法吗?

2 个答案:

答案 0 :(得分:0)

我认为,如果您按字段输入日期(输入类型文本),请使用javascript日历并修复脚本中的格式。

答案 1 :(得分:0)

像这样创建一个实用程序类。

java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.findExecutable(Ljava/lang/String;)Ljava/lang/String; error at line: 19

然后在你的jsp页面中这样做。

public class DateUtil {
    public static final String BY_DEFAULT_DATE_FORMAT = "dd/MM/yyyy";
}