From 2fd5f1356efa84930857c88b365579f77e9e43f9 Mon Sep 17 00:00:00 2001 From: thinkgem Date: Wed, 11 Sep 2019 21:06:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20beetl3.0=20=E4=B8=8D?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E9=97=AE=E9=A2=98=20ex.class.name=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=20type.fullName(ex)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/core/src/main/resources/config/beetl-core.properties | 1 + modules/core/src/main/resources/views/error/400.html | 4 ++-- modules/core/src/main/resources/views/error/500.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/core/src/main/resources/config/beetl-core.properties b/modules/core/src/main/resources/config/beetl-core.properties index 6f2c8801..9bdcd996 100644 --- a/modules/core/src/main/resources/config/beetl-core.properties +++ b/modules/core/src/main/resources/config/beetl-core.properties @@ -83,6 +83,7 @@ FN.json = org.beetl.ext.fn.Json FN.pageCtx = org.beetl.ext.fn.PageContextFunction FN.type.new=org.beetl.ext.fn.TypeNewFunction FN.type.name=org.beetl.ext.fn.TypeNameFunction +FN.type.fullName=com.jeesite.common.beetl.ext.fn.TypeFullNameFunction FN.global=org.beetl.ext.fn.DynamicGlobalValueFunction FN.allGlobal=org.beetl.ext.fn.AllGlobaAsJsonlFunction FN.hasAttribute=org.beetl.ext.fn.HasAttributeFunction diff --git a/modules/core/src/main/resources/views/error/400.html b/modules/core/src/main/resources/views/error/400.html index 59e26d6f..a97bcee7 100644 --- a/modules/core/src/main/resources/views/error/400.html +++ b/modules/core/src/main/resources/views/error/400.html @@ -8,14 +8,14 @@ if (isBlank(message)){ if (ex != null){ if(@StringUtils.startsWith(@ex.getMessage(), 'msg:')){ message = @StringUtils.replace(@ex.getMessage(), 'msg:', ''); - }else if (ex.class.name == 'org.springframework.validation.BindException'){ + }else if (type.fullName(ex) == 'org.springframework.validation.BindException'){ for (var e in ex.globalErrors){ message = message + '☆' + e.defaultMessage + '(' + e.objectName + ')
'; } for (var e in ex.fieldErrors){ message = message + '☆' + e.defaultMessage + '(' + e.field + ')
'; } - }else if (ex.class.name == 'javax.validation.ConstraintViolationException'){ + }else if (type.fullName(ex) == 'javax.validation.ConstraintViolationException'){ for (var v in ex.constraintViolations) { message = message + '☆' + v.message + '(' + v.propertyPath + ')
'; } diff --git a/modules/core/src/main/resources/views/error/500.html b/modules/core/src/main/resources/views/error/500.html index 9da68c38..a1bbfa02 100644 --- a/modules/core/src/main/resources/views/error/500.html +++ b/modules/core/src/main/resources/views/error/500.html @@ -11,7 +11,7 @@ if (isBlank(message)){ if (@StringUtils.startsWith(e.message!, "msg:")){ message = @StringUtils.replace(e.message!, "msg:", ""); break; - }else if (type.name(e) == 'ServiceException'){ + }else if (type.fullName(e) == 'com.jeesite.common.service.ServiceException'){ message = e.message!; break; }