⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 managercommentedit.jsp

📁 里面包含了一个网上书店要的大致的文件。主要是现实前台的jsp页面。
💻 JSP
字号:
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
--%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'managerEdit.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
     
<%@page contentType="text/html"%>
<%@ page import="java.sql.*" %>
<%@ page import="com.iss.bean.dataPageBean" %>
<%@ page import="com.iss.dataBase.SQLParser" %>
<%@ page import="java.util.*" %>
<%!
  public static String strTruncate(String source,int len,String delim)
  {
      if(source==null) return null;
      int start,stop,byteLen;
      int alen=source.getBytes().length;
      if(len>0)
          {
          if(alen<=len) return source;
          start=stop=byteLen=0;
          while(byteLen<=len)
              {
              if(source.substring(stop,stop+1).getBytes().length==1)byteLen++;
              else byteLen+=2;
              stop++;
              }
              StringBuffer sb=new StringBuffer(source.substring(start,stop-1));
              if(alen>len)sb.append(delim);
              return sb.toString();
          }
         return null;
  }
  
%>
<jsp:useBean id="datapagebean"  class="com.iss.bean.dataPageBean" scope="session"/>
 <%
 Statement stmt=SQLParser.getInstance().getStmt();
 String sql = "select * from comment ";
 ResultSet rs = stmt.executeQuery(sql);
 String pages=request.getParameter("dipage");
 rs.last();
 int countRecord=rs.getRow();int countPageRecord=5;
 if(pages==null||(pages.trim()).length()==0)
     (datapagebean).setAll(countRecord,countPageRecord);
     else
         {
           try
                   {
                   (datapagebean).setCurrentPage(Integer.parseInt(pages));
                   }
                   catch(Exception e)
                   {
                       out.println("bu zhen que");               
                   }
         }
         int currentRecord=(datapagebean.getCurrentPage()-1)*(datapagebean).getsizePage();
         if(currentRecord==0) ((ResultSet)rs).beforeFirst();
         else ((ResultSet)rs).absolute(currentRecord);
         out.print("<Table border=1>");
         out.print("<TR width='228' height='53' scope='row'> <TD width='228' height='53' scope='row'>发言人</TD> <TD width='228' height='53' scope='row'>发言内容</TD><TD>发言时间</TD><TD>删除</TD></TR>");
         int i=0;
         while((rs).next())
            {
            out.print("<TR>");
            out.print("<TD width='228' height='53' scope='row'>"+rs.getString("customername")+"</TD>");
             out.print("<TD width='228' height='53' scope='row'>"+strTruncate(rs.getString("commentContent"),6,"....")+"</TD>");
              out.print("<TD width='228' height='53' scope='row'>");
              String temp=rs.getString("commentTime");
              out.print(temp);
              out.print("</TD>");
              out.print("<TD width='228' height='53' scope='row'> ");
              
              out.print("<a href=deleteComment.jsp?commentTime="+(temp.replaceAll(" " ,"@"))+">delete</a>");              
              out.print("</TD>");
             out.print("</TR>"); 
             i++;
             if(i>=((dataPageBean)datapagebean).getsizePage()) break;
            }
           out.print("</Table>");
            out.print("共 "+((dataPageBean)datapagebean).getCountRecord()+"条记录 ,共"+((dataPageBean)datapagebean).getCountPage()+"页,当前第"+((dataPageBean)datapagebean).getCurrentPage()+"页,每页"+((dataPageBean)datapagebean).getsizePage()+"条记录");
            if(((dataPageBean)datapagebean).getCountPage()!=1) 
                {
                out.print("<a href=managerCommentEdit.jsp?dipage=1>首页</a>,");
                out.print("<a href=managerCommentEdit.jsp?dipage="+((datapagebean).getCurrentPage()-1)+">前一页</a>,");
           
                
                }
                if((datapagebean).getCountPage()==(datapagebean).getCurrentPage())
                    {                    
                    }
                    else
                        {
                       out.print("<a href=managerCommentEdit.jsp?dipage="+((datapagebean).getCurrentPage()+1)+">下一页</a>,");
                       out.print("<a href=managerCommentEdit.jsp?dipage="+((datapagebean).getCountPage())+">末页</a>,");
                        
                        
                        }
                       
                       
                       
 %>
 
  </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -