我通过发布请求将数据发送到安装到的路径:
public class AJAXPostPort extends ByteArrayResource implements IResource {
...
@Override
protected byte[] getData(Attributes attributes) {
attributes.getRequest().getPostParameters(); <- EMPTY
...
}
...
}
并且无法得到它:(。来自客户端的请求是正确的并且从PHP中获取。
你可以帮帮我吗?如何从wicket模块中捕获帖子请求?答案 0 :(得分:0)
很简单:
@Override
protected byte[] getData(Attributes attributes) {
HttpServletRequest request;
request = (HttpServletRequest)attributes.getRequest().getContainerRequest();
String data=null;
try {
data = IOUtils.toString( req.getInputStream()); <- GET REAL POST DATA
} catch ( IOException e ) {
e.printStackTrace();
}
...
}