doga
doga

Reputation: 491

"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"
}

Upvotes: 11

Views: 17910

Answers (1)

Safwan Hijazi
Safwan Hijazi

Reputation: 2089

Add:

import org.springframework.http.HttpStatus;

Upvotes: 23

Related Questions