String responseString = null;
String zipCode = req.getParameter("zip");
if (zipCode != null) {
HashMap location = getCityState(zipCode);
if (location==null || location.size()==0){
location = new HashMap();
String message = "Zip code: "+zipCode+" is not in the database. Please enter your City and State";
location .put("message",message);
}
responseString = RicoUtil.buildRicoObjectXML(location,"");
}
if (responseString != null) {
System.out.println(responseString);
res.setContentType("text/xml");
res.setHeader("Cache-Control", "no-cache");
res.getWriter().write(responseString);
} else {
// If key comes back as a null, return a question mark.
res.setContentType("text/xml");
res.setHeader("Cache-Control", "no-cache");
res.getWriter().write("?");
}