addproduct.jsp页面代码:
product.jsp页面代码:
- <%@page pageEncoding="GBK" contentType="text/html; charset=GBK" %>
- <%@ taglib uri="struts-html" prefix="html" %>
- <%@ taglib uri="struts-logic" prefix="logic" %>
- <%@ taglib uri="struts-bean" prefix="bean" %>
- <%
- String flag=(String)request.getAttribute("flag");
- String fieldname="";
- String value="";
- if(flag.equals("2")){
- fieldname=(String)request.getAttribute("fieldname");
- value=(String)request.getAttribute("value");
- }
- String maxid=(String)request.getAttribute("maxid");
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
- <title></title>
- <html:base/>
- <html:javascript formName="productsForm" method="validate"/>
- <script Language="JavaScript">
- function btn_AddFolder() {
- if(confirm("确定要保存吗?")){
- if(document.productsForm.onsubmit()){
- document.forms[0].submit();
- }
- }
- }
- </script>
- </head>
- <body>
- <a href="/game/returnProduct.do?method=doReturnProduct&&flag=<%= flag%>&&fieldname=<%=fieldname%>&&value=<%= value%>">返回</a>
- <html:form action="/addProduct.do" onsubmit="return validate(this)">
- <table border="1">
- <tr>
- <td>游戏中文名称</td>
- <td>游戏英文名称</td>
- <td>软件版本</td>
- <td>软件介质</td>
- <td>碟数</td>
- <td>版权</td>
- <td>价格(元)</td>
- <td>攻略</td>
- </tr>
- <tr>
- <td><html:text property="gameNameCn"/></td>
- <td><html:text property="gameNameEn"/></td>
- <td>
- <html:select property="gameVersion" >
- <html:option value= "2">英文版 </html:option>
- <html:option value= "1">中文版</html:option>
- </html:select>
- </td>
- <td>
- <html:select property="gameMedia" >
- <html:option value= "1">CD </html:option>
- <html:option value= "2">DVD5</html:option>
- <html:option value= "3">DVD9</html:option>
- </html:select>
- </td>
- <td><html:text property="gameCapacity" size="5"/></td>
- <td>
- <html:select property="gameCopyright" >
- <, //www.blogjava.net/Images/OutliningIndicators/None.gif" align=top> <html:select property="gameVersion" >
- <html:option value= "2">英文版 </html:option>
- <html:option value= "1">中文版</html:option>
- </html:select>
- </td>
- <td>
- <html:select property="gameMedia" >
- <html:option value= "1">CD </html:option>
- <html:option value= "2">DVD5</html:option>
- <html:option value= "3">DVD9</html:option>
- </html:select>
- </td>
- <td><html:text property="gameCapacity" size="5"/></td>
- <td>
- <html:select property="gameCopyright" >
- <html:option value= "2">翻版 </html:option>
- <html:option value= "1">正版</html:option>
- </html:select>
- </td>
- <td><html:text property="gamePrice"/></td>
- <td><html:text property="gameContent"/></td>
- </tr>
- </table>
- <html:hidden property="gameId" value="<%= maxid%>"/>
- <html:hidden property="method" value="doAddProduct"/>
- <html:hidden property="flag" value="<%= flag%>"/>
- <html:hidden property="fieldname" value="<%= fieldname%>"/>
- <html:hidden property="value" value="<%=value%>"/>
- <input type="button" value="保存" onclick="btn_AddFolder()"/>
- </html:form>
- </body>
- </html>
product.jsp页面代码:
- <%@page pageEncoding="GBK" contentType="text/html; charset=GBK" %>
- <%@ taglib uri="struts-html" prefix="html" %>
- <%@ taglib uri="struts-logic" prefix="logic" %>
- <%@ taglib uri="struts-bean" prefix="bean" %>
- <%
- String flag=(String)request.getAttribute("flag");
- String fieldname="";
- String value="";
- if(flag.equals("2")){
- fieldname=(String)request.getAttribute("fieldname");
- value=(String)request.getAttribute("value");
- }
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
- <title></title>
- <html:javascript formName="productsForm" method="validate"/>
- </head>
- <body>
- <a href="/game/addProductPage.do?method=doAddProductPage&&flag=<%= flag%>&&fieldname=<%=fieldname%>&&value=<%= value%>">添加</a>
- <a href="/game/returnProduct.do?method=doReturnProduct&&flag=<%= flag%>&&fieldname=<%=fieldname%>&&value=<%= value%>">返回</a>
- <a href="/game/deleteProduct.do?method=doDeleteProduct&&flag=<%= flag%>&&gameId=<bean:write name="pd" property="gameId"/>&&fieldname=<%=fieldname%>&&value=<%= value%>">删除</a>
- <br>
- <br>
- <html:form action="/updateProduct.do" onsubmit="return validate(this)">
- <table border="1">
- <tr>
- <td>游戏中文名称</td>
- <td>游戏英文名称</td>
- <td>软件版本</td>
- <td>软件介质</td>
- <td>碟数</td>
- <td>版权</td>
- <td>价格(元)</td>
- <td>攻略</td>
- </tr>
- <tr>
- <td><html:text name="pd" property="gameNameCn"/></td>
- <td><html:text name="pd" property="gameNameEn"/></td>
- <td>
- <html:select name="pd" property="gameVersion" >
- <html:option value= "1">中文版 </html:option>
- <html:option value= "2">英文版</html:option>
- </html:select>
- </td>
- <td>
- <html:select name="pd" property="gameMedia" >
- <html:option value= "1">CD </html:option>
- <html:option value= "2">DVD5</html:option>
- <html:option value= "3">DVD9</html:option>
- </html:select>
- </td>
- <td><html:text name="pd" property="gameCapacity" size="5"/></td>
- <td>
- <html:select name="pd" property="gameCopyright" >
- <html:option value= "1">正版 </html:option>
- <html:option value= "2">翻版</html:option>
- </html:select>
- </td>
- <td><html:text name="pd" property="gamePrice" size="10"/></td>
- <td><html:text name="pd" property="gameContent"/></td>
- </tr>
- </table>
- <html:hidden property="method" value="doUpdateProduct"/>
- <html:hidden name="pd" property="gameId" />
- <html:hidden property="flag" value="<%= flag%>"/>
- <html:hidden property="fieldname" value="<%= fieldname%>"/>
- <html:hidden property="value" value="<%=value%>"/>
- <html:submit property="submit" value="保存"></html:submit>
- </html:form>
- </body>
- </html>