<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ page language="java" contentType="text/html; charset=utf-8" %>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>

<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>

<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

 

<html:html xhtml="true" lang="true">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Simple Struts Demo</title>

<html:base/>

<link rel="stylesheet" type="text/css" href="../../css/example.css" />

</head>

<body>

<h1>Simple Struts Demo</h1>

<hr noshade="noshade"/>

 

<html:errors/>

<html:form action="/simple">

      <table>

      <tr><td>* Lastname: </td><td><html:text property="lastname" size="40" maxlength="50"/></td></tr>

      <tr><td>* Firstname: </td><td><html:text property="firstname" size="40" maxlength="50"/></td></tr>

      <tr><td>  Address: </td><td><html:text property="address" size="80" maxlength="80"/></td></tr>

      <tr><td>  Weight: </td><td><html:text property="weight" size="5"/></td></tr>

      <tr><td>  Birthdate: </td><td><html:text property="birthdateString" size="20" /></td></tr>

      </table>

      <p>What is your favorite color?: 

        <html:select property="color">

          <html:option value="red">Red</html:option>

          <html:option value="green">Green</html:option>

          <html:option value="blue">Blue</html:option>

        </html:select>

    </p>

      <p><html:checkbox property="married"/>Are you married?</p>

      <p>How much do you like yourself?: <br/>

            <table>

            <tr>

            <td><label><html:radio property="rating" value="1">&#160;Actually, I hate me.</html:radio></label></td>

            <td><label><html:radio property="rating" value="2">Not so much.</html:radio><br /></label></td>

            <td><label><html:radio property="rating" value="3">I'm indifferent</html:radio><br /></label></td>

            <td><label><html:radio property="rating" value="4">I'm pretty neat</html:radio><br /></label></td>

            <td><label><html:radio property="rating" value="5">I'm totally in love with me.</html:radio></label></td>

            </tr>

            </table>

      </p>

      <p>

            <html:submit value="Submit"/>

            <html:cancel/>

      </p>

      <input type="hidden" name="subaction" value="addperson"/>

</html:form>

<br/>

<hr noshade="noshade" />  

<table border="1">

<tr>

<th>Firstname</th><th>Lastname</th><th>Address</th><th>Weight</th><th>Birthdate</th><th>Color</th><th>Married</th><th>Rating</th>

</tr>

<logic:present name="personBeans">

<logic:iterate id="personBean" name="personBeans">

      <tr>

      <td>${personBean.lastname}</td>

      <td>${personBean.firstname}</td>

      <td>${personBean.address}</td>

      <td>${personBean.weight}</td>

      <td><bean:write name="personBean" property="birthdate" format="dd.MM.yyyy" /></td>

      <td>${personBean.color}</td>

      <td>${personBean.married}</td>

      <td>${personBean.rating}</td>

      </tr>

</logic:iterate>

</logic:present>

</table>

</body>

</html:html>