REST 웹 서비스에서 여러 쿼리 매개 변수를 푸는 방법을 아는 사람이 있습니까? 내가 쓰기 java.My 컬 샘플을 사용하여이는 다음과 같이이다 :REST 웹 서비스에서 여러 쿼리 매개 변수를 푸시하는 방법
@PUT
@Path("{user}/{directory:.+}")
public Response doshare(@PathParam("user")String name,
@PathParam("directory")String dir,
@QueryParam("name")String sharename,
@QueryParam("type")String type){
mongoDAOImpl impl=new mongoDAOImpl();
Mongo mongo=impl.getConnection("127.0.0.1","27017");
DB db=impl.getDataBase(mongo,"public");
DBCollection coll=impl.getColl(db,name);
DBCollection coll2=impl.getColl(db,"sharedb");
shareDTO sharedto=new shareDTO();
String authority=type.toLowerCase();
if(authority.equals("rd")){
sharedto.setAuthority("4");
}else if(authority.equals("rw")){
sharedto.setAuthority("12");
}
sharedto.setTargetuser(sharename);
sharedto.setRealURI("/home/public/"+name+"/"+dir);
sharedto.setIdentifier(name);
sharedto.setParentURI("/home/public/"+sharename);
boolean bool = false;
sharefun=new sharefunction();
if(sharefun.checksubfoldershared(coll, coll2, sharedto)){
bool=sharefun.sharefiles(coll, coll2, sharedto);
}else{
System.out.println("Error");
}
// ...
하지만 이름 만 쿼리 parameter.How이 얻을 수 또는 컬을 입력하는 방법 :
curl -X PUT http://localhost:8080/project/resources/user/directory/sub-directory?name=shareuser&type=Read -v
내 프로그램입니다 명령을 사용하여 모든 쿼리 매개 변수를 가져 옵니까?
PUT 및 쿼리 매개 변수? 기분이 좋지 않아. –
해결 방법은 없습니까? 창 기반 응용 프로그램을위한 웹 서비스를 작성 중입니다. 나는 aldy 웹 응용 프로그램이 있습니다. – sudo
내 대답보기. –