JXMLWhois Wiki
Query Whois server in Java and get a uniform xml result
Status: Beta
Brought to you by:
foxxav35
First of all, dont't forget to put the properties file (in conf folder) in the classpath ;-)
Just a little snippet to quicly create a jsp page that return the whois parsing result :
<%@page import="java.io.IOException"%>
<%@page import="java.net.UnknownHostException"%>
<%@page import="java.io.Writer"%>
<%@page import="org.fox.jxmlwhois.JWhoisClient"%>
<%@page contentType="text/xml" pageEncoding="UTF-8"%>
<%
Writer wri = response.getWriter();
try {
String query = request.getParameter("query");
if ((query!=null)&&(!"".equals(query))){
JWhoisClient whois = new JWhoisClient();
wri.write(whois.queryWhois(query));
} else {
wri.write("<error>Il faut appeller la page avec le parametre query=xxx</error>");
}
} catch (Exception ex) {
ex.printStackTrace();
wri.write("<error>" + ex.getMessage()+ "</error>");
} finally {
wri.flush();
}
%>