ProductList.jsp
<%@ page import="vincent.SLSBean.*" %>
<%@ page import="vincent.CMP.*" %>
<%@ page import="java.util.*" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/lib/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/lib/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/lib/struts-logic.tld" prefix="logic" %>
<html:html>
<title>ProductList.jsp</title>
<head>
<html:base/>
</head>
<html:form action="/ProductList">
<body>
<font size=6 color=cc0000>
<bean:message key="ProductList.indicator" locale="Locale"/>
<br>
<br>
<table border=4>
<tr>
<th bgcolor=cccccc>
<bean:message key="prompt.ID" locale="Locale"/>
</th>
<th bgcolor=cccccc>
<bean:message key="prompt.Name" locale="Locale" />
</th>
<th bgcolor=cccccc>
<bean:message key="prompt.RetailPrice" locale="Locale" />
</th>
<logic:equal name="LoginForm" property="username" scope="session" value="Admin">
<th bgcolor=cccccc>
<bean:message key="prompt.WholeSalePrice" locale="Locale" />
</th>
</logic:equal>
<th bgcolor=cccccc>
<bean:message key="prompt.Quantity" locale="Locale" />
</th>
<th bgcolor=cccccc>
<bean:message key="prompt.Choice" locale="Locale" />
</th>
</tr>
<logic:iterate id="element" type="vincent.actions.ProductForm" name="array">
<tr>
<td>
<bean:write name="element" property="id" />
</td>
<td>
<bean:write name="element" property="name" />
</td>
<td>
<bean:write name="element" property="retailPrice" />
</td>
<logic:equal name="LoginForm" property="username" scope="session" value="Admin">
<td>
<bean:write name="element" property="wholeSalePrice" />
</td>
</logic:equal>
<td>
<bean:write name="element" property="quantity" />
</td>
<td>
<input type="radio" name="choice" value=<%=element.getId()%> >
</td>
</tr>
</logic:iterate>
</table>
<table>
<tr>
<td>
<logic:equal name="PageForm" property="hasPrevious" scope="session" value="yes">
<html:link href="/OBSH/View.do?pageInfo=previous">
previous
</html:link>
</logic:equal>
</td>
<td>
<logic:equal name="PageForm" property="hasNext" scope="session" value="yes">
<html:link href="/OBSH/View.do?pageInfo=next">
next
</html:link>
</logic:equal>
</td>
</tr>
</table>
<br><br>
<table>
<tr>
<logic:equal name="LoginForm" property="username" scope="session" value="Admin">
<th>
<input type="submit" value="Add" name="submit">
</th>
<th>
<input type="submit" value="Delete" name="submit">
</th>
<th>
<input type="submit" value="Edit" name="submit">
</th>
</logic:equal>
<th>
<input type="submit" value="Detail" name="submit">
</th>
<logic:equal name="LoginForm" property="username" scope="session" value="Customer">
<th>
<input type="submit" value="Discount" name="submit">
</th>
</logic:equal>
</tr>
</table>
</html:form>
</body>
</html:html>
Logon.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="/WEB-INF/lib/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/lib/struts-bean.tld" prefix="bean" %>
<html:html locale="true">
<head>
<html:base/>
<title>
<bean:message key="logon.title" />
</title>
<html:javascript formName="LoginForm" />
</head>
<body>
<font size=4 color=cc0000>
<html:errors locale="Locale" />
<html:form action="/Login" focus="username" οnsubmit="return validateLoginForm(this)">
<table border="0" width="100%">
<tr>
<th align="right">
<bean:message key="prompt.username" locale="Locale" />
</th>
<td align="left">
<html:text property="username" size="16" />
</td>
</tr>
<tr>
<th align="right">
<bean:message key="prompt.password" locale="Locale" />
</th>
<td align="left">
<html:password property="password" size="16" />
</td>
</tr>
</table>
<br><br>
<input type="submit" value="submit">
</html:form>
</body>
</html:html>