Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Error: HttpStatus cannot be resolved to a variable" How to resolve This?

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"
}
like image 911
doga Avatar asked Jun 04 '15 16:06

doga


1 Answers

Add:

import org.springframework.http.HttpStatus;
like image 83
Safwan Hijazi Avatar answered Oct 21 '22 16:10

Safwan Hijazi