resp.setContentType("text/plain");
final PrintWriter writer = resp.getWriter();
final String jndiName = req.getParameter(PARAM_JNDI_NAME);
try {
final Context ctx = new InitialContext();
final Hello ejbObject = (Hello) ctx.lookup(jndiName);
final String msg = ejbObject.sayHello();
LOGGER.info(msg);
writer.append(msg);
ctx.close();
} catch (NamingException ex) {
LOGGER.warn("Unable to get EJB.", ex);