【问题标题】:Combining a spring REST Service with a JSF Page将 Spring REST 服务与 JSF 页面相结合
【发布时间】:2018-02-02 00:09:46
【问题描述】:

我尝试了spring REST tutorial,我还得到了一个简单的 JSF 应用程序(在 glassfish 上运行),这两个项目都是基于 maven 的,我想“组合”它们。 意思是,将 REST 项目 jar 放入 JSF 项目中。 这有意义吗?

JSF 页面应在启动时向微服务 REST 项目发送请求并显示结果。

REST 项目使用 spring-boot,因此使用 tomcat。 这个pom.xml 应该使用 glassfish 而不是 tomcat,至少作者在 spring blog 上是这么说的。

里面有一部分:

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-tomcat</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

这表示“排除”tomcat - 这很好,但是 maven 或 spring 怎么知道要使用 glassfish 呢?

有没有更好的方法来结合这两个项目? 由于 pom.xml 中的依赖关系,我想将项目分开。

【问题讨论】:

    标签: spring maven


    【解决方案1】:

    此问题中的答案#1 解决了困惑:
    Using JSF as view technology of Spring MVC

    spring mvc 和 jsf 是对手。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-20
      • 2018-06-12
      • 1970-01-01
      • 2018-01-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多