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

📄 note_005flist_jsp.java

📁 这是基于jsp的任务管理系统
💻 JAVA
字号:
package org.apache.jsp.guanli.note;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import cn.edu.bit.business.*;
import java.util.*;
import cn.edu.bit.Object.*;
import cn.edu.bit.DBQuery.DataProcess;

public final class note_005flist_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.List _jspx_dependants;

  public Object getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=GB2312");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("<html>\r\n");
      out.write("<head>\r\n");
      out.write("<title>Lomboz JSP</title>\r\n");
      out.write("<style type=\"text/css\">\r\n");
      out.write("<!--\r\n");
      out.write("@import url(\"../../css/OSX.css\");\r\n");
      out.write("-->\r\n");
      out.write("</style>\r\n");
      out.write("</head>\r\n");
      out.write("\r\n");
      out.write("<body bgcolor=\"#CAD7F7\" topmargin=\"50\">\r\n");

String str = (String) request.getQueryString();
	       
int page_note;

if (str == null)
     page_note = 1;
else {
	// 根据‘=’来析取参数值
	String[] aa = str.split("=");
	page_note = Integer.parseInt(aa[1]);
	   }
	   
String strSql = new String("select * from note order by datetime desc");

int count = DataProcess.nCount("select count(*) from note");
			
			int totalPages = 0;
			
			if(count%5==0)
			{
				totalPages=count/5;
			}
			else
			{
				totalPages = count/5+1;
			}
			
			int currentPage=1;
			
			if(page_note<=0)
			{
				currentPage=1;
			}
			else if(page_note>totalPages)
			{
				currentPage=totalPages;
			}
			else
			{
				currentPage = page_note;
			}
		//----------------------------------------------------------	
			// 并将这些Bean保存在容器类中,然后返回
            Vector Items = Note_Manager.search(strSql, page_note);

      out.write("\r\n");
      out.write("<div align=\"center\">\r\n");
      out.write("<table width=\"80%\"  border=\"0\" cellspacing=\"1\" cellpadding=\"1\" class=\"tableBorder\">\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td colspan=\"2\" align=\"center\" background=\"../../images/guanli/admin_bg_1.gif\" class=\"whitenormal\">留言列表</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  \r\n");
      out.write("  ");

  	for (int i = 0; i < Items.size(); i++) 
    {
         Note bean = (Note) Items.elementAt(i);
  
      out.write("\r\n");
      out.write("  <tr bgcolor=\"E4EDF9\">\r\n");
      out.write("    <td width=\"14%\" align=\"center\" class=\"normalText\">标题:</td>\r\n");
      out.write("    <td width=\"86%\" class=\"normalText\">");
      out.print(bean.getTitle());
      out.write("</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr bgcolor=\"F1F3F5\">\r\n");
      out.write("    <td align=\"center\" class=\"normalText\">作者:</td>\r\n");
      out.write("    <td class=\"normalText\">");
      out.print(bean.getAuthor());
      out.write("</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr bgcolor=\"F1F3F5\">\r\n");
      out.write("    <td align=\"center\" class=\"normalText\">时间:</td>\r\n");
      out.write("    <td class=\"normalText\">");
      out.print(bean.getDatetime());
      out.write("</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr bgcolor=\"F1F3F5\">\r\n");
      out.write("    <td align=\"center\" class=\"normalText\">内容:</td>\r\n");
      out.write("    <td class=\"normalText\">");
      out.print(bean.getContent());
      out.write("</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  <tr>\r\n");
      out.write("    <td colspan=\"2\">&nbsp;</td>\r\n");
      out.write("  </tr>\r\n");
      out.write("  ");
}
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\t<tr>\r\n");
      out.write("        \t\r\n");
      out.write("     <td colspan=\"2\">\r\n");
      out.write("     \t<table width=\"100%\"  border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"E4EDF9\">\r\n");
      out.write("        \t\r\n");
      out.write("        \t<tr class=\"normalText\">\r\n");
      out.write("\r\n");
      out.write("        \t<td>页次:");
      out.print(currentPage);
      out.write('/');
      out.print(totalPages);
      out.write("页&nbsp;每页5 总数");
      out.print(count);
      out.write("</td>\r\n");
      out.write("\r\n");
      out.write("        \t<td align=\"right\">分页:\r\n");
      out.write("        \t\r\n");
      out.write("        \t<a href=\"note_list.jsp?arg1=-1\">首页</a> \r\n");
      out.write("        \t\r\n");
      out.write("        \t<a href=\"note_list.jsp?arg2=-2\">上一页</a>\r\n");
      out.write("        \t\r\n");
      out.write("        \t<a href=\"note_list.jsp?arg3=-3\">下一页</a> \r\n");
      out.write("        \t \r\n");
      out.write("           <a href=\"note_list.jsp?arg4=-4\">尾页</a></td>\r\n");
      out.write("\r\n");
      out.write("        \t</tr>\r\n");
      out.write("\r\n");
      out.write("        \t</table></td>\r\n");
      out.write("\r\n");
      out.write("        \t</tr>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("</table>\r\n");
      out.write("\r\n");
      out.write("</div>\r\n");
      out.write("\r\n");
      out.write("</body>\r\n");
      out.write("</html>");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}

⌨️ 快捷键说明

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