问题描述
我有一个处理 SOAP WebService 的现有 spring-boot 应用程序,我想向应用程序添加一个基本的 UI 页面。
现有配置使用@EnableWS 注释显示如下,但 Servlet 的 URL 模式会抓取所有请求。
@EnableWs
@Configuration
public class WebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean messagedispatcherServlet(ApplicationContext applicationContext) {
MessagedispatcherServlet servlet = new MessagedispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet,"/*"); // this url pattern grabs every thing
}
我想添加一个简单的 MVC 控制器,它会在收到任何具有“/ui/*”模式的请求时调用。
@Controller()
@RequestMapping("/ui")
public class UIController {
在不影响 '/' 上现有的 SOAP 服务的情况下,是否有一种无缝的方式来配置 spring 来处理特定的 ui 请求?我可以只使用 @EnableWebMvc 注册一个配置 bean 还是只使用 WebMvcConfigurerAdapter?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)