小编Aru*_*mar的帖子

java.lang.NoSuchMethodError: org.springframework.web.method.support.HandlerMethodArgumentResolverComposite

我正在构建一个 Spring Restful 项目,其中我应用了摘要身份验证的 Spring Security,我已将 Spring 依赖项的版本从 3.0.4 升级到 3.1,因此我遇到以下错误: java.lang.NoSuchMethodError:org.springframework.web .method.support.HandlerMethodArgumentResolverComposite.addResolvers(Ljava/util/List;)Lorg/springframework/web/method/supportHandlerMethodArgumentResolverComposite;

我必须将 spring 的新版本升级到 3.1 才能使用其安全前景。请帮我解决这个问题。

下面是我的 spring 框架的 pom.xml 中的依赖项:

<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${spring.version}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-acl</artifactId>
            <version>${spring-security.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId> …
Run Code Online (Sandbox Code Playgroud)

spring maven-2 spring-mvc spring-security

1
推荐指数
1
解决办法
3977
查看次数

在java中将前导0字符串转换为整数

我的java类中有以下字符串

String str="0000000000008";
Run Code Online (Sandbox Code Playgroud)

现在我想增加它,以便下一个值应该是0000000000009

为此,我尝试将此String str转换为Integer

Integer i=Integer.parseFloat(str)+1;
Run Code Online (Sandbox Code Playgroud)

当我打印i它的值时,它只打印17(因为它在转换时从字符串中删除了前导0).

如何增加String值,以便保留前导0,系列将继续?

java string casting increment number-formatting

1
推荐指数
2
解决办法
3909
查看次数

在Java中更改字符串值

我有

String newStr = "previous"
Run Code Online (Sandbox Code Playgroud)

过了一段时间我想把我的字符串改成next.我现在能做到

newStr=getNewString(); // Say getNewString return `next`
Run Code Online (Sandbox Code Playgroud)

Arent字符串应该是不可变的.

我能用其他任何方式实现这个目标吗 谢谢.

编辑:neww代替new

java string immutability

1
推荐指数
1
解决办法
139
查看次数

使GTK TreeView中的行无法选择

我想让PyGTK Tree-view(耦合到List Store)的选择行不可选,如果可能的话,显示为灰色.

有没有办法做到这一点?

python gtk pygtk

0
推荐指数
1
解决办法
1832
查看次数

如何在Java中调用具有数组类型的构造函数

我想在Motor类中创建一个构造函数(Motor),我想在Contructor1类中调用它,但是当我这样做时我有一个错误.....我不知道为什么.我刚刚从本周开始学习java.

这是代码:

  class Motor{
        Motor(int type[]){
            int input;
            input=0;
            type = new int[4];
            for(int contor=0; contor<4; contor++){
                System.out.println("Ininsert the number of cylinders:");
                Scanner stdin = new Scanner(System.in);
                    input = stdin.nextInt();
                type[contor] = input;
                System.out.println("Motor with "+type[contor]+" cylinders.");
            }
        }
    }

    public class Contructor1 {
        public static void main(String[] args){
            Motor motor_type;
            for(int con=0; con<4; con++){
                motor_type = new Motor();
            }

            }

        }
Run Code Online (Sandbox Code Playgroud)

java arrays

0
推荐指数
1
解决办法
902
查看次数

GeoJSON:检查地理坐标是否在多边形内

我有以下 GeoJSON 数据文件,其中包含一个带坐标的多边形。

[
    {
        "geometry": {
        "type": "Polygon",
        "coordinates": 
[
        [
          [
            9.137248,
            48.790411
          ],
          [
            9.137248,
            48.790263
          ],
          [
            9.13695,
            48.790263
          ],
          [
            9.137248,
            48.790411
          ]
        ]
      ]
    }
    }
  ]
Run Code Online (Sandbox Code Playgroud)

在 的帮助下org.geotools.geojson.geom.GeometryJSON,我正在解析com.vividsolutions.jts.geom.Polygon类中的 JSON 坐标,如下所示。并检查是否Coordinate(9.13710, 48.790360)在这个多边形内。

GeometryJSON g = new GeometryJSON();
         com.vividsolutions.jts.geom.Polygon polygon = g.readPolygon(new File(fileLocation));
         System.out.println("Type="+polygon.getGeometryType());

         GeometryFactory gf = new GeometryFactory();
         boolean pointIsInPolygon = polygon.contains(gf.createPoint(new Coordinate(9.13710, 48.790360)));
         System.out.println("Point is in polygon="+pointIsInPolygon);
Run Code Online (Sandbox Code Playgroud)

但是我的程序总是给我下面的结果,即给定的坐标不在多边形中。

结果

类型=多边形

点在多边形中=假

a) 你能看出为什么pointIsInPolygon是假的。我错过了什么吗?

b) 我应该在这里给出什么坐标,所以 …

java geometry point-in-polygon geojson geotools

0
推荐指数
1
解决办法
3029
查看次数