Hi,
I have this jsp client that consumes a webservice. The problem with the client is whenever it calls the webservice and retrieves the result, it appends the result to the previous call's result and displays it. But, if i redeploy the war file, the result appears fine. (only for the first time though)
Here's the code without the import statements.
<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>
Thanks, Deepak.