MCPcopy Create free account
hub / github.com/diyhi/bbs / handle

Method handle

src/main/java/cms/security/WebSecurityConfig.java:222–233  ·  view source on GitHub ↗
(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException)

Source from the content-addressed store, hash-verified

220 return new AccessDeniedHandler(){
221
222 @Override
223 public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException)
224 throws IOException, ServletException {
225 if (!response.isCommitted()) {
226 //向Header头写入信息
227 response.setHeader("message", UriUtils.encode(accessDeniedException.getMessage(),"UTF-8"));//不支持中文参数 用UriUtils.encode代替URLEncoder.encode,解决空格转换成+号的问题
228 response.sendError(HttpStatus.FORBIDDEN.value(),//返回403错误
229 HttpStatus.FORBIDDEN.getReasonPhrase());//错误信息
230
231 }
232
233 }
234
235 };
236 }

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.80
getMessageMethod · 0.65

Tested by

no test coverage detected