In this JavaEE EJB JPA Tutorial, we will create html form for the Stateful Session bean. This html form resides in the JSP file itself.
ShoppingCart.jsp – V1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!-- Sample 2.5: Java Objects used here. We already have Project Dependancy set as part of previous stateless bean demo --> <!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 2.6: Html Form to Collect Input --> <form action="ShoppingCart.jsp" method="post"> Place Item into Shopping Cart: <input type="text" size=35 value="" name="Purchased" /> <input type="submit" value="Add to Cart" name="CartAction"/> <input type="submit" value="Remove From Cart" name="CartAction" /> <input type="submit" value="List items in Cart" name="CartAction"/> <input type="submit" value="Empty Cart" name="CartAction" /> </form> </body> </html> |
Categories: JavaEE-EJB-Tube