Это правильно?
Я хочу получить переменную из параметра метода @PUT в веб-службе REST.
Но я получаю переменную "Null", как получить параметр?
Может кто-нибудь сказать мне?
@PUT
@Produces("application/html")
public Response postContainer(@PathParam("objecturi")String path){
mongoDAOImpl impl=new mongoDAOImpl();
Mongo mongo=impl.getConnection("127.0.0.1","27017");
DB db=impl.getDataBase(mongo,"public");
DBCollection coll=impl.getColl(db,"public");
mongoDTO dto=new mongoDTO();
dto.setParentpath("/home/public/liren");
dto.setUserName("liren");
dto.setPassWord("liren");
dto.setFileName(path);
dto.setAbsolutepath(dto.getParentpath()+"/"+dto.getFileName());
boolean bool;
try{
file= new filemethods();
bool=file.createcontainers(coll, dto, path);
if(bool==true){
return Response.status(Response.Status.OK).build();
}else {
return Response.status(Response.Status.NOT_ACCEPTABLE).build();
}
}catch(Exception ex){
return Response.status(Response.Status.BAD_REQUEST).tag("Container create error"+ex.toString()).build();
}