简体   繁体   中英

Capturing parameters appended to the DWR3 query string?

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(...)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM