Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @POST
- @Path("/add")
- public Response add(@FormParam("name") String name, @FormParam("description") String description){
- if(name != null){
- Role r_to_rec = new Role();
- r_to_rec.setName(name);
- if(description != null){
- r_to_rec.setDescription(description);
- }
- if(r_to_rec.add()){
- return Response.status(201).build();
- }else{
- return Response.status(418).build();
- }
- }else{
- return Response.status(404).build();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment