“Error: HttpStatus cannot be resolved to a variabl

2019-04-28 13:48发布

I am getting error in below code at line 2: @ResponseStatus(HttpStatus.OK). Error is: "HttpStatus cannot be resolved to a variable". What imports are required for this? Am i missing any necessary jar file? Any help?

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

     Return "User Validated"
}

1条回答
淡お忘
2楼-- · 2019-04-28 14:16

Add:

import org.springframework.http.HttpStatus;
查看更多
登录 后发表回答