@Resource public class DvdsController extends Object
DvdController handles all Dvd operations,
such as adding new Dvds, listing all Dvds, and so on.
This is a RESTful Resource, so we will explain how to use REST on
VRaptor 3 here.
POST /dvds -> adds a dvd
GET /dvds/{id} -> shows the dvd of given id| Constructor and Description |
|---|
DvdsController(DvdDao dao,
UserInfo userInfo,
Result result,
Validator validator)
Receives dependencies through the constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(Dvd dvd,
UploadedFile file)
Accepts HTTP POST requests.
|
void |
search(Dvd dvd)
Accepts HTTP GET requests.
|
void |
show(Dvd dvd)
Accepts HTTP GET requests.
|
@Path(value="/dvds") @Post public void add(Dvd dvd, UploadedFile file)
UploadedFile is automatically handled
by VRaptor's MultipartInterceptor.@Path(value="/dvds/{dvd.id}") @Get public void show(Dvd dvd)
Copyright © 2015 Caelum. All Rights Reserved.