Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
820b4407
提交
820b4407
authored
1月 20, 2018
作者:
xuxueli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
国际化定制
上级
7a362378
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
28 行增加
和
12 行删除
+28
-12
WebExceptionResolver.java
...l/job/admin/controller/resolver/WebExceptionResolver.java
+23
-6
500.html
xxl-job-admin/src/main/webapp/500.html
+4
-3
common.result.ftl
...src/main/webapp/WEB-INF/template/common/common.result.ftl
+0
-2
help.ftl
xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl
+1
-1
没有找到文件。
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/resolver/WebExceptionResolver.java
浏览文件 @
820b4407
...
...
@@ -11,6 +11,7 @@ import org.springframework.web.servlet.ModelAndView;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* common exception resolver
...
...
@@ -24,18 +25,33 @@ public class WebExceptionResolver implements HandlerExceptionResolver {
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
{
logger
.
error
(
"WebExceptionResolver:{}"
,
ex
);
ModelAndView
mv
=
new
ModelAndView
();
// if json
boolean
isJson
=
false
;
HandlerMethod
method
=
(
HandlerMethod
)
handler
;
ResponseBody
responseBody
=
method
.
getMethodAnnotation
(
ResponseBody
.
class
);
if
(
responseBody
!=
null
)
{
response
.
setContentType
(
"application/json;charset=UTF-8"
);
mv
.
addObject
(
"result"
,
JacksonUtil
.
writeValueAsString
(
new
ReturnT
<
String
>(
500
,
ex
.
toString
().
replaceAll
(
"\n"
,
"<br/>"
))));
mv
.
setViewName
(
"/common/common.result"
);
isJson
=
true
;
}
// error result
ReturnT
<
String
>
errorResult
=
new
ReturnT
<
String
>(
ReturnT
.
FAIL_CODE
,
ex
.
toString
().
replaceAll
(
"\n"
,
"<br/>"
));
// response
ModelAndView
mv
=
new
ModelAndView
();
if
(
isJson
)
{
try
{
response
.
setContentType
(
"application/json;charset=utf-8"
);
response
.
getWriter
().
print
(
JacksonUtil
.
writeValueAsString
(
errorResult
));
}
catch
(
IOException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
);
}
return
mv
;
}
else
{
mv
.
addObject
(
"exceptionMsg"
,
ex
.
toString
().
replaceAll
(
"\n"
,
"<br/>"
));
mv
.
addObject
(
"exceptionMsg"
,
errorResult
.
getMsg
());
mv
.
setViewName
(
"/common/common.exception"
);
}
return
mv
;
}
}
}
\ No newline at end of file
xxl-job-admin/src/main/webapp/500.html
浏览文件 @
820b4407
...
...
@@ -2,7 +2,7 @@
<html>
<head>
<meta
charset=
"UTF-8"
>
<title>
应用程序异常 (500)
</title>
<title>
Error
</title>
<style
type=
"text/css"
>
body
{
background-color
:
#fff
;
color
:
#666
;
text-align
:
center
;
font-family
:
arial
,
sans-serif
;
}
div
.dialog
{
...
...
@@ -21,8 +21,9 @@
<body>
<div
class=
"dialog"
>
<h1>
应用程序异常
</h1>
<p>
抱歉!您访问的页面出现异常,请稍后重试或联系管理员。
</p>
<h1>
System Error
</h1>
<p>
Oops! Page not found.
</p>
<a
href=
"javascript:window.location.href='${request.contextPath}/'"
>
Back
</a>
</div>
</body>
...
...
xxl-job-admin/src/main/webapp/WEB-INF/template/common/common.result.ftl
deleted
100644 → 0
浏览文件 @
7a362378
${result?if_exists}
\ No newline at end of file
xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl
浏览文件 @
820b4407
...
...
@@ -25,7 +25,7 @@
<h4>
${I18n.admin_name_full}
</h4>
<br>
<p>
<a
target=
"_blank"
href=
"https://github.com/xuxueli/xxl-job"
>
g
ithub
</a>
<a
target=
"_blank"
href=
"https://github.com/xuxueli/xxl-job"
>
G
ithub
</a>
<iframe
src=
"https://ghbtns.com/github-btn.html?user=xuxueli&repo=xxl-job&type=star&count=true"
frameborder=
"0"
scrolling=
"0"
width=
"170px"
height=
"20px"
style=
"margin-bottom:-5px;"
></iframe>
<br><br>
<a
target=
"_blank"
href=
"http://www.xuxueli.com/xxl-job/"
>
${I18n.job_help_document}
</a>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论