使用JSP + JAVABEAN + XML 开发的一个例子__教程 |
|
日期:2007-5-20 1:24:45 人气:185 [大 中 小] |
|
|
|
if (strAct==null){ strOperation="show"; }else{ if (strAct.equals("modi")){ strOperation="modi"; intId=Integer.parseInt(request.getParameter("recordId")); }else{ if(strAct.equals("addnew")){ strOperation="addnew"; }else{ strOperation="show"; } } }
//如果为空记录,则变更页面状态为“新增” if (restaurants.getLength()==0){ strOperation="addnew"; } %>
<html> <head> <title>oddWorld 餐饮系统</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta http-equiv="expires" content="0"> <link rel="stylesheet" href="../../include/itsp.css" type="text/css"> </head>
<body > <div align="center"> <table width="100%" border="0" cellspacing="0" cellpadding="0" height="22"> <tr> <td width="1"><img src="../../http://www.mbsky.com/infoview/images/top_r1.GIF" width="62" height="22"></td> <td width=150 align="center"> 餐饮系统管理--餐馆管理</td> <td><img src="../../http://www.mbsky.com/infoview/images/top_r2.GIF" width="294" height="22"></td> <td width=100 align="center"><a href="/index.html">[ 退出系统 ]</a></td> </tr> </table> <br> <br> <table bgcolor="#999999" align=center border=0 cellpadding=1 cellspacing=1 width="90%"> <tbody> <tr bgcolor="#efefef" align="center" valign="middle"> <td class=ttTable height=30 width="20"> </td> <td class=ttTable height=30 width="0">餐馆名称</td> <td class=ttTable height=30 width="0">餐馆电话</td> <td class=ttTable height=30 width="0"> <div align="center">餐馆地址</div> </td> <td class=ttTable height=30 width="30"> <div align="center">修改</div> </td> <td class=ttTable height=30 width="30"> <div align="center">删除</div> </td> </tr> <% for(int i=0;i<restaurants.getLength();i++) { Element restaurant=(Element) restaurants.item(i);
if (strOperation=="modi" && Integer.parseInt(restaurant.getAttributeNode("id").getNodeValue())==intId){ %> <%//显示修改的格式%> <tr align="center" bgcolor="#ffffff" valign="middle"> <form name=dataform action="<%=request.getRequestURI()%>?act=modiDo" method="post" onSubmit=''return checkform(this);'' > <td class=tdsmall height=25 width="20"> <input type="hidden" name="recordId" value="<%=restaurant.getAttributeNode("id").getNodeValue()%>"> <%=(i+1)%></td> <td class=tdsmall height=25> <input name="name" class=stedit style="HEIGHT: 22px; WIDTH: 150px" value="<%if(restaurant.getElementsByTagName("name").item(0).hasChildNodes()){ out.print(restaurant.getElementsByTagName("name").item(0).getFirstChild().getNodeValue()); |
|
出处:本站原创 作者:佚名 |
|
|