columns_main.jsp
上传用户:junmaots
上传日期:2022-07-09
资源大小:2450k
文件大小:3k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@page contentType="text/html; charset=GBK" language="java" %>
  2. <%@page import="com.mycompany.news.service.ColumnService" %>
  3. <%@page import="com.mycompany.news.dto.Column" %>
  4. <%@page import="java.util.List"%>
  5. <%
  6. String columnid = request.getParameter("columnid");
  7. if(columnid==null)return;
  8. ColumnService cs = new ColumnService();
  9. Column c = cs.getByID(Long.parseLong(columnid));
  10. List children = cs.listChildren(c);
  11. %>
  12. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  13. <html>
  14. <head>
  15. <link href="../css/common.css" rel="stylesheet" type="text/css">
  16. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head>
  17. <body  leftmargin="0" topmargin="0" marginwidth="15" marginheight="2" CLASS="TA">
  18. <br>
  19. <br>
  20. <br>
  21. <br><br>
  22. <table  border="0" cellpadding="0" cellspacing="0" align='left' width='70%'>
  23.  
  24.  <form name="form1" action="<%=request.getContextPath()%>/servlet/ModifyColumn" method="post">
  25.   <input type="hidden" name="columnid" value="<%=c.getColumnId()%>">
  26.   <input type="hidden" name="channelid" value="<%=c.getChannelId()%>">
  27.   <input type="hidden" name="parentcolumn" value="<%=c.getParentColumn()%>">
  28.   <input type="hidden" name="topcolumn" value="<%=c.getTopColumn()%>">
  29.   <input type="hidden" name="currentlevel" value="<%=c.getCurrentLevel()%>">
  30.   <input type="hidden" name="leafnode" value="<%=c.getLeafNode()%>">
  31.  <tr> 
  32. <td width='100'>栏目名称</td>
  33. <td><input name="columnname" value="<%=c.getColumnName()%>"></td>
  34. <td width='100'>栏目顺序</td>
  35. <td><input name="columnorder" value="<%=c.getColumnOrder()%>"></td>
  36. <td><input type='button' value="保存" class="input-button" onclick="form1.submit()"></td>
  37.   </tr>
  38. </table>
  39. <form name="form2" action="<%=request.getContextPath()%>/servlet/AddColumn" method="post">
  40.   <input type="hidden" name="parentcolumn" value="<%=c.getColumnId()%>"> 
  41.   <input type="hidden" name="channelid" value="<%=c.getChannelId()%>">
  42.   <tr> 
  43. <td width='100'>子栏目名称</td>
  44. <td><input name="columnname" value=""></td>
  45. <td width='100'>子栏目顺序</td>
  46. <td><input name="columnorder" value=""></td>
  47. <td><input type='button' class="input-button" value="添加" onclick="form2.submit()"></td>
  48.   </tr>
  49.   
  50. </form>
  51. <br>
  52. <br>
  53. <br>
  54. <br>
  55. <table  align='left' width='70%' border="0" cellpadding="0" cellspacing="0" align='center' class="tbcolor">
  56.   <tr class="titletab"> 
  57. <th align='center'>顺序</th><th align='center'>名称</th><th align='center'>修改</th><th align='center'>删除</th>
  58.   </tr> 
  59.   <%for(int i=0;i<children.size();i++){
  60.    Column column = (Column )children.get(i);
  61.   %>
  62.    <form name="form<%=column.getColumnId()%>" action="<%=request.getContextPath()%>/servlet/DeleteColumn">
  63.     <input type="hidden" name="columnid" value="<%=column.getColumnId()%>">
  64.    </form>  
  65. <tr>
  66.   <td align='center'>· <%=c.getColumnOrder()%></td> 
  67.  <td align='center'><%=column.getColumnName()%></td> 
  68.   <td align='center'><a href='columns_main.jsp?columnid=<%=column.getColumnId()%>'><image src="../images/modify.gif" border=0/></a></td>
  69.  <td align='center'><a href='#' onclick="deleteColumn(form<%=column.getColumnId()%>)"> <image src="../images/delete.gif" border=0/></a></td>
  70. </tr>
  71.   <%}%>
  72. </table>
  73. </body>
  74. </html>
  75. <script>
  76. function deleteColumn(frm){
  77. if(confirm('确定删除栏目?')){
  78. frm.submit();
  79. }
  80. }
  81. </script>