%@ page language="java" session="false" contentType="text/html;charset=iso-8859-1" import="org.apache.axis.discovery.client.Client, java.util.List, org.apache.axis.discovery.core.Const, java.io.IOException, java.io.PrintWriter, java.io.StringWriter"%>
"); out.write(endpoint); out.write(" |
\n"); StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); out.write(sw.toString()); out.write(""); } public int getIntParam(HttpServletRequest request, String name, int defVal) { int result; try { result = Integer.parseInt(request.getParameter(name)); } catch (NumberFormatException e) { result = defVal; } return result; } %> <% /* * demo page to use discovery to find and display services. * yes, jsps with code are ugly, but JSTL is even worse to debug */ String uri=request.getParameter(uriParam); if(uri==null) { %> <% } else { int ttl= getIntParam(request,"ttl",3); int timeout= getIntParam(request, "ttl", 1)*1000; int limit= getIntParam(request, "limit", 0); %>
Searching...
<% try { Client client; List responses; String[] endpoints; client = new Client(); responses= client.findEndpoints(uri, ttl, timeout, limit); endpoints = client.extractEndpointArray(responses); listEndpoints(endpoints,out); } catch (Throwable e) { logException(out,e); } } %>