Java Reference
In-Depth Information
L ISTING 12.9
Continued
quote.setCustomerName(custName);
quote.setPhoneNumber(phoneNumber);
quote.setLoanAmount(principal);
quote.setMonthlyPayment(payment);
quote.setInterestRate(interestRate);
}
catch (ClassNotFoundException ex) {
throw new ServletException(ex);
12
}
catch (NamingException ex) {
throw new ServletException(ex);
}
catch (CreateException ex) {
throw new ServletException(ex);
}
catch (RemoteException ex) {
throw new ServletException(ex);
}
// Create a simple screen as output from the servlet.
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println(“<html>”);
out.println(“<head><title>EJBTestServlet</title></head>”);
out.println(“<body>”);
out.println(“<p>”);
out.println(“The current interest rate is: “
+ interestRate + “<br>”);
out.println(“For the loan amount of: “ +
principal + “<br>”);
out.println(“Your monthly payment will be: “ + payment +
“<br>”);
out.println(“</p>”);
out.println(“</body></html>”);
}
/**Clean up resources*/
public void destroy() {
 
Search WWH ::




Custom Search