add.jsp


<html>
<head>
     <link rel="stylesheet" href="css/mi.css" type="text/css">
</head>
<body>
 <jsp:useBean id="tableViewDefinition" scope="session" class="persistenceexample4.bean.TableViewDefinition" />  

<!-- For event handling we need a HTML "form" command -->
 <form method="post" action="start" id="form1" name="form2">
<!-- Disply title of the example -->
 <font face="'Arial Narrow',sans-serif">
    <!-- Display header panel -->
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#fffbd5">
      <tr bgcolor="#fffbd5" class="headerPanel">
          <td align="left" valign="middle" class="headerPanel" ><%=tableViewDefinition.getHeaderPanelEntryLeft() %> </td>
          <td align="right" valign="middle" class="headerPanel" ><%=tableViewDefinition.getHeaderPanelEntryRight()%> </td>
      </tr>
  </table>
<!-- Command line - contains the commands add, delete etc.. The commands are separated by 2 blanks-->
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#fffbd5">
      <tr bgcolor="#fffbd5">    
      <td class="commandLine" width="20%">
        <input type="submit" value="Add" class="image" name="_event_addEntrySubmit" >          
      </td>
      <td class="commandLine">
<!-- In constants.jave we refer to the event as EVENT_NAME = "name" . The AbstractMEHttpServlet analyses 
     the string "_event_name" and passes "name" to the "doHandleEvent" method as "eventName" -->
        <input type="submit" value="Cancel" class="image" name="_event_addEntryCancel" >          
      </td>
      </tr>
  </table>
  <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#fffbd5">
      <tr bgcolor="#fffbd5">              
<!-- Title of page -->
        <td class="centerPageTitle"><%=tableViewDefinition.getCenterPageTitle()%></td>
      </tr>
  </table>
  
  <table border="0" class="BoxOut" cellpadding="0" cellspacing="5" width="210">
    <tr class="miBody" >
      <td align="right">
        make:

      </td>
      <td>
<!-- The parameter "name" in the JSP has to match the parameter in "request.getParameter("MAKE")"
     in the servlet -->
        <input type="text" name="MAKE" size="20">
      </td>
    </tr>
    <tr class="miBody" >
      <td align="right">
        model:

      </td>
      <td>
<!-- The parameter "name" in the JSP has to match the parameter in "request.getParameter("MODEL")"
     in the servlet -->
        <input type="text" name="MODEL" size="20">
      </td>
    </tr>
    <tr class="miBody" >
      <td align="right">
        engine type:

      </td>
      <td>
<!-- The parameter "name" in the JSP has to match the parameter in "request.getParameter("ENGINE")"
     in the servlet -->
        <select name="ENGINE" >
            <option>Gasoline</option>
            <option>Diesel</option>
            <option>Hydrogen</option>
            <option>Electric/Hybrid</option>
           </select>
      </td>
    </tr>
    <tr class="miBody" >
      <td align="right">
        cylinders:

      </td>
      <td>
<!-- The parameter "name" in the JSP has to match the parameter in "request.getParameter("CYLINDERS")"
     in the servlet -->
        <select name="CYLINDERS" >
            <option>4</option>
            <option>3</option>
            <option>5</option>
            <option>6</option>
            <option>8</option>
            <option>10</option>
            <option>12</option>
           </select>
      </td>
    </tr>
    <tr class="miBody" >
      <td align="right">
        valves/cylinder:

      </td>
      <td>
<!-- The parameter "name" in the JSP has to match the parameter in "request.getParameter("VALVES")"
     in the servlet -->
        <select name="VALVES" >
            <option>2</option>
            <option>3</option>
            <option>4</option>
           </select>
      </td>
    </tr>
    <tr class="miBody" >
      <td align="right">
        licence #:

      </td>
      <td>
<!-- The parameter "name" in the JSP has to match the parameter in "request.getParameter("LICENSE")"
     in the servlet -->
        <input type="text" name="LICENSE" size="20">
      </td>
    </tr>
 </table>
 <!-- Display footer panel -->
 <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr bgcolor="#eff6fb" class="footerpanel" >
          <td align="left" valign="middle" class="footerPanel" ><%=tableViewDefinition.getFooterPanelEntryLeft() %> </td>
          <td align="right" valign="middle" class="footerPanel">add.jsp</td>
      </tr>
 </table>
 </font>
 </form>
</body>
</html>