丄諦啲仇魜ヤ
          如 果 敵 人 讓 你 生 氣 , 那 說 明 你 沒 有 勝 他 的 把 握!
          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 閱讀(1563) 評論(0)  編輯  收藏 所屬分類: Jsp+Struts
          主站蜘蛛池模板: 施秉县| 石楼县| 襄垣县| 阿合奇县| 溧水县| 拉萨市| 德昌县| 河北区| 留坝县| 永顺县| 进贤县| 福安市| 河北省| 洛浦县| 台山市| 邢台市| 简阳市| 建德市| 潼关县| 宝丰县| 阿勒泰市| 闽清县| 怀化市| 伊宁县| 宾阳县| 绥阳县| 黄浦区| 洞口县| 桂东县| 泸西县| 高雄市| 延吉市| 长汀县| 青岛市| 禹州市| 利川市| 淄博市| 出国| 彩票| 江孜县| 五华县|