Refactor and little change of spring configuration,and prepare for integrating Shiro