javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handl

经检查是我 springmvc 配置有问题

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;


@Configuration
@EnableWebMvc
@ComponentScan("com.wisely.springmvc4")
public class MyMvcConfig {
@Bean // 出现问题原因 @bean 忘记添加
public InternalResourceViewResolver viewResolver(){
InternalResourceViewResolver viewResolver=new InternalResourceViewResolver();
viewResolver.setPrefix("/WEB-INF/classes/views/");
viewResolver.setSuffix(".jsp");
viewResolver.setViewClass(JstlView.class);
return viewResolver;
}


}


你可能感兴趣的:(javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handl)