丄諦啲仇魜ヤ
          如 果 敵 人 讓 你 生 氣 , 那 說 明 你 沒 有 勝 他 的 把 握!
          posts - 6,comments - 56,trackbacks - 1

          <tr>  
             <th> ID  </th>
              <th> 姓名</th>
              <th>密碼</th>
              <th>  刪除? </th>
          </tr>
          <%
              List userList=(List)request.getAttribute("userList");
              for(int i=0;i<userList.size();i++)
              {
                TUser tUser=(TUser)userList.get(i);
             %>
             <tr>
             <td ><%=tUser.getUsername() %></td>
            
             <td><%=tUser.getPassword() %></td>
              <td>
             <html:link action="/deleteUser.do?userId=${User.id}">&nbsp;&nbsp;刪除</html:link>
           </td>
             </tr>
             <%
            
               }
              %>
          /*********************************************************************************/

          <tr>
                 <th>
               ID
              </th>
              <th>
               姓名
              </th>
              <th>
               密碼
              </th>
              <th>
               刪除?
              </th>
              
                         </tr>

             <logic:present name="userList" scope="request">
              <logic:iterate id="User" name="userList" indexId="index">
               <tr>
                <td>
                 ${User.id}
                </td>
                <td>
                 <bean:write name="User" property="username" />
                </td>
                <td>
                 <bean:write name="User" property="password" />
                </td>
                <td>
                 <html:link action="/deleteUser.do?userId=${User.id}">&nbsp;&nbsp;刪除</html:link>
                </td>

               </tr>
              </logic:iterate>

             </logic:present>

          ///////////////***********************************//////////////////////////
          <body>
            <%
                 HashMap<String,String> mapYear=new HashMap<String,String>();
                 mapYear.put("0","1980");
                 mapYear.put("1","1981");
                 mapYear.put("2","1982");
                 mapYear.put("3","1983");
                 request.setAttribute("mapYear",mapYear);
                  HashMap<String,String> mapMonth=new HashMap<String,String>();
                 mapMonth.put("0","01");
                 mapMonth.put("1","02");
                 mapMonth.put("2","03");
                 mapMonth.put("3","04");
                 request.setAttribute("mapMonth",mapMonth);
                  HashMap<String,String> mapDay=new HashMap<String,String>();
                 mapDay.put("0","1");
                 mapDay.put("1","2");
                 mapDay.put("2","3");
                 mapDay.put("3","4");
                 request.setAttribute("mapDay",mapDay);
            %>

            <html:form action="/addStudent" focus="username">
            
               username : <html:text property="username" />
             <html:errors property="username" />
             <br />
               password : <html:password property="password" />
             <html:errors property="password" />
             <br />
             
             sex : <html:radio property="sex" value="m" />男
                    <html:radio property="sex" value="f" />女<br />
             
             birthday :<html:select property="birthdayYear" size="1">
              <logic:iterate id="map1" name="mapYear" indexId="id">
               <html:option value="${map1.value}">${map1.value}</html:option>
              </logic:iterate>
             </html:select>年
                          <html:select property="birthdayMonth" size="1">
              <logic:iterate id="map2" name="mapMonth" indexId="id">
               <html:option value="${map2.value}">${map2.value}</html:option>
              </logic:iterate>
             </html:select>月
                      <html:select property="birthdayDay" size="1">
              <logic:iterate id="map3" name="mapDay" indexId="id">
               <html:option value="${map3.value}">${map3.value}</html:option>
              </logic:iterate>
             </html:select>日<br />
                     
             
             grade : <html:text property="grade" />
             
             <br />
             <html:submit />
             <html:cancel />
            </html:form>
           </body>
          /*********************struts中隔行顏色不同的顯示*************************************/


          <logic:iterate id="Produt" name="list" indexId="id">
              <bean:define id="result" value="${Produt.id%2}"></bean:define>
              <logic:equal value="0" name="result">
             <tr bgcolor="green">

              <td>
               ${Produt.typeId}
              </td>
              <td>
               ${Produt.name}
              </td>
              <td>
               ${Produt.price}
              </td>
              <td>
               ${Produt.meno}
              </td>
                          
             </tr>
             </logic:equal>
              <logic:equal value="1" name="result">
             <tr bgcolor="yellow">

              <td>
               ${Produt.typeId}
              </td>
              <td>
               ${Produt.name}
              </td>
              <td>
               ${Produt.price}
              </td>
              <td>
               ${Produt.meno}
              </td>
                          
             </tr>
             </logic:equal>
            </logic:iterate>

          posted on 2007-10-18 19:10 Crying 閱讀(1564) 評論(0)  編輯  收藏 所屬分類: Jsp+Struts
          主站蜘蛛池模板: 霍州市| 兰州市| 宜宾县| 独山县| 二连浩特市| 湖南省| 桐梓县| 扶风县| 永州市| 黄龙县| 苗栗县| 宕昌县| 上林县| 七台河市| 彰化县| 黎平县| 宁安市| 温州市| 灵武市| 垫江县| 阿尔山市| 准格尔旗| 湘潭市| 莫力| 抚远县| 平乐县| 华宁县| 麻城市| 马公市| 枣强县| 博兴县| 阿坝县| 确山县| 闽侯县| 社旗县| 曲沃县| 清流县| 冀州市| 东乡族自治县| 穆棱市| 靖江市|