提交 | 用户 | 时间
|
8286c6
|
1 |
/** |
懒 |
2 |
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng) |
|
3 |
* <p> |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* <p> |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* <p> |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
*/ |
|
16 |
package cn.stylefeng.guns.sys.core.exception.page; |
|
17 |
|
|
18 |
import org.springframework.web.servlet.View; |
|
19 |
|
|
20 |
import javax.servlet.http.HttpServletRequest; |
|
21 |
import javax.servlet.http.HttpServletResponse; |
|
22 |
import java.util.Map; |
|
23 |
|
|
24 |
/** |
|
25 |
* 错误页面的默认跳转(例如请求404的时候,默认走这个视图解析器) |
|
26 |
* |
|
27 |
* @author fengshuonan |
|
28 |
* @date 2017-05-21 11:34 |
|
29 |
*/ |
|
30 |
public class GunsErrorView implements View { |
|
31 |
|
|
32 |
@Override |
|
33 |
public String getContentType() { |
|
34 |
return "text/html"; |
|
35 |
} |
|
36 |
|
|
37 |
@Override |
|
38 |
public void render(Map<String, ?> map, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception { |
|
39 |
httpServletRequest.getRequestDispatcher("/global/error").forward(httpServletRequest, httpServletResponse); |
|
40 |
} |
|
41 |
} |