JSP Tag Libraries

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


Listing 14.18 instantiationException.jsp


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


<%@ taglib


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


EJB-driven WAPStore



<ejb:home id=»home»


type=»book.casestudy.cosmetix.ejb.CustomerManagerHome name=»ejb/customerManager»/>


<ejb:use id=»customerManager»


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


<ejb:use id=»customer ”    ,    .    . ,    Ю


type=»book.casestudy.cosmetix.ejb.Customer» instance=»<%=customerManager.getCustomer( request.getUserPrincipal().getName())%>»/>


<%


session.setAttribute(«customer»,customer);


%>


<jsp:include page=»userMenu.jsp flush=»true»/>

О Defines this page as an error page. e Gets the home interface for the CustomerManager EJB.
О Creates a remote interface for the CustomerManager EJB.
о Retrieves the Customer EJB with the username of the user currently logged in The User’s name is found in the request.
G Adds the Customer EJB to the session scope.


G Includes the user menu view This is normally the first page to request the existence of the Customer EJB in the session scope.

Mail error view


The mail error view is an error page invoked if any exception is thrown from the order confirmation view. It displays a single card alerting the user that the order has been received, although no receipt could be sent. The page is called mailExcep-tion.jsp in our application and looks like listing 14.19.


Listing 14.19 mailException.jsp


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


<%@ taglib


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


<%@ taglib


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


<%@ taglib


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


<?xml version=»1.0″?>


<!DOCTYPE wml PUBLIC «-//WAPFORUM//DTD WML 1.1//EN» «http://www.wapforum.org/DTD/wml_1.1.xml«>


<wml>


<card id=»orderConfirmation» title=»Confirmation»>


<j sp:include page=»userMenu.jsp» flush=»true»/>


<p align=»left»>


<strong>


Order Received </strong>


</p>


<p align=»left»>


Your order reference number is <strong>

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