In this EJB-JPA Tutorial, we will complete out the presentation layer JSP file. The JSP file will be invoked all the controller layer servlets and send the result of the operation to the user.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <% //Sample 4.16: Check the Response is for Create Account String Action = (String) request.getAttribute("Action"); if (Action.compareToIgnoreCase("Add") == 0) { %> <H3> Account Created</H3> <p> Account Id is: <%= request.getAttribute("NewAccountID") %> <% } //Sample 4.17: Check the Response is Deposit if (Action.compareToIgnoreCase("deposit") == 0) { %> <H3>Your Deposit amount is Credited.</H3> <p> New Account Balance is: <%= request.getAttribute("NewBalance") %> <% } //Sample 4.18: Check the Response is withdraw if (Action.compareToIgnoreCase("withdraw") == 0) { %> <H3>You withdrawn Money..</H3> <p> New Account Balance is: <%= request.getAttribute("NewBalance") %> <% } //Sample 4.19: Check the Response Account Close if (Action.compareToIgnoreCase("close") == 0) { String ret = (String) request.getAttribute("CloseVal"); if (ret.compareToIgnoreCase("True") == 0) { out.println("Account Removed"); } else { out.println("Account not found"); } } %> <h3> <a href="http://localhost:8080/EJBWeb/SavingsAcHomePage.html">Home </a> </h3> </body> </html> |
Categories: JavaEE-EJB-Tube