users@jersey.java.net

[Jersey] [Filter] how to customize context body ?

From: 유재균 <bndi_at_naver.com>
Date: Tue, 06 Jan 2009 15:25:59 +0900

Thank you Sandoz.
 
https://jersey.dev.java.net/servlets/ReadMsg?list=users&msgNo=3746
this question is related above url.
 
I have make Filter class.
--------------------------------------------------------------
public class JsonCallbackFilter implements ContainerResponseFilter{
 public ContainerResponse filter(ContainerRequest request, ContainerResponse response) {
 if(query string 'callback' is set) {
 ContainerResponseWriter crw = response.getContainerResponseWriter();
 
 // TODO how to add 'callback' value ???
 response.setContainerResponseWriter(crw);
 }
 return response;
}
--------------------------------------------------------------
 
the request url is like this.
http://xxxxxxxxxx/member/info?name=yyy&callback=zzz&type=json
 
and expected result is
zzz({"code":"12312","name":"yyy"})
 
 
please help me.
 
 
개인용자료 - 접근금지
출처가 명확하지 않은 게시물이 많이 포함되어있습니다.
관계자가 아닌분은 방문을 삼가해 주십시오.