我试着写ServletRegistrationBean方法返回MessageDispatcherServlet实例和i得到有界不匹配错误。
这是我写的方法:
public ServletRegistrationBean<MessageDispatcherServlet> requestDispatcher (ApplicationContext conext){
MessageDispatcherServlet msd = new MessageDispatcherServlet();
msd.setApplicationContext(conext);
msd.setTransformWsdlLocations(true);
servletContext.addServlet("MessageDispatcherServlet",msd);
return new ServletRegistrationBean<MessageDispatcherServlet>(msd, "/soap/*");
}
我做错了什么?
我解决了这个
issue by configuring pom file with the next dependancy:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
代替:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>