JSP Tag Libraries

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

Message


Represents a line of text that should be displayed to the user on the welcome view.


Order


Represents an order created by a user. It has a total price and contains a number of OrderItems. It belongs to a customer.


Orderltem


Represents a single row in an order. It holds the SKU, name, price, and ordered quantity of a certain product.

14.3.3 View


Fifteen views make up the system. We will go through each in order to describe their intended usage.

Logon view


The logon view is displayed each time a user tries to access the application without being logged on. This is achieved by setting the access rights for the pages that should allow only registered users, and by defining this page as the login form. All of this is defined in the web.xml file. The view is made up of two different cards, in which the first card loads the second card.


Listing 14.1 is the source for the logon view. This file is called login.jsp inside the application.

Listing 14.1 login.jsp


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


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


<simple:nocache useHeaders=»true»


useMetaTags=»false»/>


<?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=»image»


ontimer=M#loginM title=»Cosmetix»> <timer value=»100″/>


<P>


<img src=»images/logo.wbmp» alt=»Cosmetix»/>


</p>


</card>


<card id=»login»


title=»Cosmetix»>


<do type=»options» label=»Login»>


<go href=


«j_security_check?j_username=$username&amp;j_password=$passwd»/


</do>


<p align=»left»>


<input type=»text»


name =»use rname» format=»32A» title=»Username:»/>

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