问题描述
我正在迁移基于Java的旧模型1网站,以使用开发中的restful-api(长期目标是提供 PaaS 和我可以找到的任何其他流行词).
I am in the process of migrating an old model 1 java based website, to use an under development restful-api (with the long term goal of providing a PaaS and any other buzzwords I can find).
我想对不同的功能模块使用多个不同的WAR文件.我知道该怎么做
I want to use multiple different WAR files for different modules of functionality. I know how to do this
www.myLegacy.com/myWarFile/myFirstMethod
www.myLegacy.com/myWarFile/mySecondMethod
www.myLegacy.com/mySecondWarFile/ThirdMethod (in different war file, and consequently diff url)
但是我希望能够将多个war文件部署到同一个网址,例如:
However I want to be able to deploy multiple war files to the same url like :
www.myLegacy.com/myRest/myFirstMethod
www.myLegacy.com/myRest/mySecondMethod
www.myLegacy.com/myRest/ThirdMethod (this is in different war file to other methods)
这将与tomcat一起使用完整的弹簧堆栈(inc spring-mvc).
This is would use the full spring stack (inc spring-mvc) with tomcat.
请问有指针吗?
推荐答案
我不认为这是可能的,因为Tomcat在不同的上下文路径中启动了不同的war文件.我唯一能想到的就是部署myRest.war和mySecondWarFile.war,并在myRest应用程序本身中为/ThirdMethod
添加映射,并将请求路由到/mySecondWar/ThirdMethod
.
I dont think it is possible straight away as Tomcat starts different war files in different context paths. Only thing I can think of is deploying myRest.war and mySecondWarFile.war and adding a mapping for /ThirdMethod
in myRest application itself and routing the request to /mySecondWar/ThirdMethod
.
这篇关于在Tomcat上使用多个WAR的基于Spring的SOA,实现URL映射的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!