开发者

Capturing parameters appended to the DWR3 query string?

开发者 https://www.devze.com 2023-03-01 18:15 出处:网络
I have a method called myMethod which maps to the following开发者_高级运维 DWR method: List<MyObject> myMethod(String param){

I have a method called myMethod which maps to the following开发者_高级运维 DWR method:

List<MyObject> myMethod(String param){
...
return myObjects
}

A library calls this method automatically by referring to MyService.myMethod('value'), but it also appends its own params, a, and b

That is, the final request looks like this:

POST http://localhost:8080/application/dwr/jsonp/MyService/myMethod/value?a=5&b=6

Is there any way to capture the values of a and b easily through DWR?


You can get at the HttpServletRequest.

WebContext ctx = WebContextFactory.get();
ctx.getHttpServletRequest().getParam(...)
0

精彩评论

暂无评论...
验证码 换一张
取 消