Jeff
Jeff

Reputation: 8421

PUT cannot be resolved to a variable

Consider the following Rest controller:

@RequestMapping(method = PUT, path = "/orders/{oid}")
    public void PendingPO(Model model, @RequestParam(name = "id") Long id) throws Exception {
         salesService.PendingPurchaseOrder(PurchaseOrderID.of(id));       
    }

The problem is, in method = PUT it complains that:

PUT cannot be resolved to a variable

So i dob't know how can make a controller method for http method of PUT?

Upvotes: 0

Views: 206

Answers (1)

Natalia
Natalia

Reputation: 4532

You need to introduce static import for PUT:

import static org.springframework.web.bind.annotation.RequestMethod.PUT. 

Or make usual import of RequestedMethod enum and use reference to PUT: RequestMethod.PUT.

Upvotes: 1

Related Questions