在一个弹簧启动容器中运行多个Web应用程序
我希望能够有多个Web应用程序共享域项目并在不同的contextPaths下运行。
通过在spring引导应用程序中设置server.contextPath = / webshop,我不需要为所有RequestMappings添加前缀。
我希望网店,管理员和主页共享一个包含所有实体和公共服务的公共域项目。
也许有类似的东西?
public static void main(String[] args) { new SpringApplicationBuilder(Domain.class) .showBanner(false) .child(Admin.class, Webshop.class) .run(args); }
我的问题是如何使用通用域模型启动Spring启动应用程序,然后使用独特的contextPaths启动一些独立的Web应用程序?
像这样举例如:
public static void main(String[] args) { start(Admin.class, Webshop.class).run(args); start(Another.class).properties("server.port=${other.port:9000}").run(args); } private static SpringApplicationBuilder start(Class>... sources) { return new SpringApplicationBuilder(Domain.class) .showBanner(false) .child(sources); }
它将在不同的端口上启动两个应用程序。
- FocusEvent没有得到JFormattedTextField的最后一个值,我怎么能得到它?
- 将符号(“@”)转换为CharSequence
- java线程对静态类的影响
- HibernateException:当’hibernate.dialect’未设置时,对DialectResolutionInfo的访问不能为null
- 从Java访问.NET / DLL库/组件?
- 转义Java正则表达式中的特殊字符
- Spring Security 3.2.1具有不同WebSecurityConfigurerAdapters的多个登录表单
- 为什么Map.compute()采用BiFunction
- java在匿名类中实现generics接口