【问题标题】:Adding OpenID support in broadleaf commerce在阔叶商业中添加 OpenID 支持
【发布时间】:2013-05-18 21:32:16
【问题描述】:

我正在尝试将 OpenID 支持添加到阔叶商业应用程序。 我能够使用 Spring OpenID 开发出一个独立的 Web 应用程序。

在我的阔叶商务应用程序的站点/pom.xml 中,我添加了这个:-

<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-openid</artifactId>
    <version>3.1.3.RELEASE</version>
</dependency>

在此之后进行 Maven 构建会导致在应用程序中使用 @RequestMapping 的 'produces' 属性时出现编译错误。

"注解类型RequestMapping的属性未定义"

@RequestMapping(value = "/add", produces = "text/html")
public String add(HttpServletRequest request, HttpServletResponse response, Model model,

项目的构建路径确实显示了spring-web.3.0.7.RELEASE jar。

项目刷新/清理也没有帮助。

我正在使用 Broadleaf 2.0。

感谢您的帮助。

【问题讨论】:

    标签: spring-security openid broadleaf-commerce


    【解决方案1】:

    我将首先表明自己是 Broadleaf Commerce 的员工。

    我不相信“produces”属性是在 Spring-Web 3.1 之前引入的。我查看了 2.0 版 Broadleaf 核心的 pom.xml,我们指定了对 spring-web 和 spring-webmvc 3.1.3.RELEASE 的依赖。我还确认,在默认构建 Broadleaf DemoSite for 2.0 期间,3.1.3.RELEASE 版本是在 WEB-INF/lib 中生成的(并且没有其他版本)。这让我觉得你在自己的项目中声明的一个或多个附加库对早期版本的 spring-web 具有传递依赖。你可能需要在你的依赖声明中包含一个“exclusions”元素来移除有问题的依赖。

    【讨论】:

    • 添加排除项也没有帮助。
    【解决方案2】:

    简单的添加排除项并没有帮助,因为它删除了所有排除的依赖项,无论其版本如何。 (排除标记不允许您指定要排除的版本。

    我必须添加具有正确版本的排除依赖项,如下所示:-

    <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-openid</artifactId>
            <version>3.1.4.RELEASE</version>
            <exclusions>
                <exclusion>
                    <artifactId>spring-core</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-web</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-aop</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-beans</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>spring-context</artifactId>
                    <groupId>org.springframework</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>3.2.2.RELEASE</version>
        </dependency>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-05
      • 1970-01-01
      • 1970-01-01
      • 2021-02-14
      • 2018-11-06
      相关资源
      最近更新 更多