我有这个消费web服务的jsp客户端。客户端的问题在于,无论何时调用webservice并检索结果,它都会将结果附加到前一个调用的结果并显示它。但是,如果我重新部署战争文件,结果显示罚款。 (仅限第一次)jsp客户端不断附加结果并显示它
这是没有导入语句的代码。
<html>
<body>
<%! public static Reader fr; %>
<%! public static StringBuffer sb; %>
<%! private static final int BLKSIZ = 8192; %>
<%! public static String file, output; %>
<%
FileparserService service = new FileparserService();
Fileparser port = service.getFileparserPort();
sb = new StringBuffer();
char[] b = new char[BLKSIZ];
int n;
try {
fr = new FileReader(<file>);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
while ((n = fr.read(b)) > 0)
sb.append(b, 0, n);
file = sb.toString();
output = port.getRanks(file);
%>
The final output is <br/>
<%out.print(output); %>
</body>
<% fr.close(); %>
</html>
谢谢, Deepak。
请发布您的代码(JSP)。这将帮助我们找到问题。但从JSP调用Web服务? – 2010-03-14 01:11:09
嗨,我发布的代码。是的,我正在使用jsp来使用基于SOAP的WS。 – Deepak 2010-03-14 01:18:11