This may be a little off topic for struts.
I want my JSP/struts page to accept XML data submission from another
server written in Delphi/windows. I know only XML data has been sent,
but I just can not get it from JSP.
I tried:
StringBuffer sb = new StringBuffer();
java.io.BufferedReader in = req.getReader();
if (in.ready()) {
in.reset();
String line;
char[] c = new char[req.getContentLength()];
int i = in.read(c);
if (i>0) sb.append(new String(c));
}
in.close();
or
java.net.URL url = new java.net.URL(req.getScheme(),
req.getServerName(),
req.getServerPort(),
req.getContextPath());
String = (String)url.getContent();
They all failed to give the XML document. Could somebody help?
Thanks,
Deping