how to use Shiro in Spring MVC with java-config (just for the newer )
I am totally new for Shiro. I understood most of people can use XML configuration both for Spring MVC and Shiro.
but since Spring 3.0 + (if I am wrong, please correct me). Spring suggest the first choice is java code config for Spring MVC.
so I when switch my app to SpringMVC, I tried to use Shiro with java code config, Unfortunately, there is a few document talked about this thing, even on the Shiro official site. so, I sent email out ask help in this list. thanks for Brian’s help. and thanks google , I tried Many times. finally, I make it work prefect. so, I think I should be write these down. and share with people who want to use Shiro in Springmvc with java code config.
the first thing we should understand java code config, we have to use subclass the class :WebApplicationInitializer for register filter for Shiro. also, we have to subclass AbstractAnnotationConfigDispatcherServletInitializer for springmvc and load the mainly configuration files.
you can do these in one class too. but I like use two. one is for springmvc and another one is just for Shiro.
class: WebApplicationInitializer, it is just for Spring MVC