JSP Tag Libraries

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


О Iterates through the order items.


Includes the ordered quantity of the item.

1! Includes the item’s SKU.
Includes the item’s name.
1# Includes the locally formatted item price.
1$ Ends the order item iteration.
1% Includes the locally formatted order total price.


Includes the user’s company name.


Ф Includes the user’s name.


1*


Includes the user’s address.


Ф End of the message body.

2) End of mail message.


2! Displays the customer’s email address The last thing we do is display a message informing the user that a receipt has been sent to his mail address.


In the page, we do a number of nifty things. First, we define that if any runtime exception is thrown in this page, the file mailException.jsp is to be displayed. After that, we verify that we have an Order bean in the request scope (placed there by the confirmation handler) and add it to the page scope (to use as part of parameter in tags). We also add the Customer bean from the session scope to the page scope.


We then display the order reference number to the user.

Listing 13.26 The configuration of the mail service in the web.xml file


<context-param>


<param-name>from_sender</param-name> Ь <param-value>your.email@address.com</param-value> C </context-param>


<context-param>


<param-name>smtp_server_host</param-name> <param-value>smtp.host.com</param-value> </context-param>

О Defines the name of the Context parameter.
© Defines the value of the Context parameter.


In listing 13.26 we define the names of the two Context parameters where our <send> tag will look for the sender address and the SMTP server host to use for sending the email.

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