1. springsecurity.xml配置
<beans:bean class=”org.springframework.web.servlet.view.InternalResourceViewResolver”>
<beans:property name=”prefix” value=”/WEB-INF/JSP/”/>
<beans:property name=”suffix” value=”.JSP”/>
</beans:bean>
2.继承WebMvcConfigureAdapter 的java类配置
@Bean
public InternalResourceViewResolver internalresource()
{
InternalResourceViewResolver internalresource1 =new InternalResourceViewResolver();
internalresource1.setPrefix(“/WEB-INF/JSP/”);
internalresource1.setSuffix(“.jsp”);
return internalresource1;
}
3.在application.properties/或者在application.yml 配置
spring.mvc.view.prefix=/WEB-INF/JSP/
spring.mvc.view.suffix=.jsp