Commit 4a7cb11b by stylefeng

恢复视图解析器

parent c5f3d96a
......@@ -46,8 +46,8 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>provided</scope>
</dependency>
......
package com.stylefeng.guns.core.base.controller;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.View;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
/**
* 错误页面的默认跳转(例如请求404的时候,默认走这个视图解析器)
*
* @author fengshuonan
* @date 2017-05-21 11:34
*/
@Component("error")
public class GunsErrorView implements View {
@Override
public String getContentType() {
return "text/html";
}
@Override
public void render(Map<String, ?> map, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception {
httpServletRequest.getRequestDispatcher("/global/error").forward(httpServletRequest, httpServletResponse);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment