JSP Tag Libraries

Скачать в pdf «JSP Tag Libraries»


orderManager.addItem(request.getParameter(«sku»), new Integer(


request.getParameter(«quantity»)).intValue());


%>


<simple:redirect location=»categoryList.jsp»/>


О Gets the remote interface of the Customer EJB We retrieve the remote interface of the Customer EJB from the session scope and add it to the page scope. e Gets the home interface for the OrderManager EJB.


e Creates an OrderManager Session EJB We use the OrderManager EJB’s home interface to create an OrderManager remote interface using the Customer EJB as parameter.


О Adds the specified quantity of the specified product to the order We use the remote interface of the OrderManager to add a specified quantity of a certain product as an OrderItem to the users’ current Order. Then we redirect the user back to the category list view.

Remove item view


The remove item view is used to add OrderItems to the user’s current order. The page is called itemRemover.jsp in our application, and looks like
listing 14.15.


EJB-driven WAPStore


Listing 14.15 itemRemover.jsp


<%@ page contentType=»text/vnd.wap.wml;charset=UTF-8″%> <%@ taglib


uri=»
http://www.manning.com/jsptagsbook/simple-taglib» prefix=»simple» %>


<%@ taglib


uri=»http://www.manning.com/jsptagsbook/ejb-taglib» prefix=»ejb» %>




<j sp:useBean id=»customer»


type=»book.casestudy.cosmetix.ejb.Customer scope=»session»/>


<ejb:home id=»home»


<ejb:use


type=»book.casestudy.cosmetix.ejb.OrderManagerHome name=»ejb/orderManager»/> id=»orderManager»


type=»book.casestudy.cosmetix.ejb.OrderManager» instance=»<%=home.create(customer)%>»/>


<%


О


orderManager.removeItem(request.getParameter(«sku»))


%>


<simple:redirect


location=»fullOrder.jsp»/>


Gets the remote interface of the Customer EJB We retrieve the remote interface of the Customer EJB from the session scope and add it to the page scope.


Gets the home interface for the OrderManager EJB.


Creates an OrderManager EJB Uses the Customer EJB as parameter.

Скачать в pdf «JSP Tag Libraries»