"错误:HttpStatus无法解析为变量"怎么解决这个?

时间:2015-06-04 16:19:34

标签: spring rest spring-mvc model-view-controller

我在第2行的代码中遇到错误:@ResponseStatus(HttpStatus.OK)。错误是:" HttpStatus无法解析为变量"。需要进口什么?我错过了任何必要的jar文件吗?有什么帮助吗?

@RequestMapping( value = "/{id}", method = RequestMethod.GET )
@ResponseStatus(HttpStatus.OK)
@ResponseBody
public String validateUser( @PathVariable( "id" ) String id){

     Return "User Validated"
}

1 个答案:

答案 0 :(得分:12)

添加:

array (size=7)
  0 => 
    object(stdClass)[260]
      public 'nom' => string 'lorem' (length=6)
      public 'id' => string '1' (length=1)
      public 'code' => string 'lorem' (length=5)
      public 'contracts' => 
        array (size=14)
          0 => 
            object(stdClass)[258]
              ...
          1 => 
            object(stdClass)[257]
              ...
          2 => 
            object(stdClass)[256]
              ...
  1 => 
    object(stdClass)[261]
      public 'nom' => string 'lorem.... lorem' (length=19)
      public 'id' => string '2' (length=1)
      public 'code' => string 'lorem..... lorem' (length=13)
      public 'contracts' => 
        array (size=4)
          0 => 
            object(stdClass)[270]
              ...
          1 => 
            object(stdClass)[269]
              ...