jackmew / spring-boot-security

This spring-boot-security is the project to record how I learn Spring Securtity taught by DTR Trading.
0 stars 3 forks source link

add a custom access denied(403) page. #14

Closed jackmew closed 10 years ago

jackmew commented 10 years ago
  1. AccessDeniedHandler

image

when 403 error pops up , AccessDeniedHandler will be activated , and it can print out the url which cause 403.

  1. Configurate AccessDeniedExceptionHandler to @Bean

image

setErrorPage 到某一個url , 這一個url連到controller去處理error. setErrorPage request for a url , and this url link to controller which will manage erro .

  1. controller

image

dispatch to 403 custom page.

  1. template

image