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

📄 background_jsp.java

📁 新闻网络中心 sql2000 jsp tomcat
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.util.List;
import com.actionForm.NewsForm;

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

  private static java.util.Vector _jspx_dependants;

  public java.util.List 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,
      			"", 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<link rel=\"stylesheet\" href=\"css/style.css\">\r\n\r\n\r\n");
      com.tool.TimeShow time = null;
      synchronized (request) {
        time = (com.tool.TimeShow) _jspx_page_context.getAttribute("time", PageContext.REQUEST_SCOPE);
        if (time == null){
          time = new com.tool.TimeShow();
          _jspx_page_context.setAttribute("time", time, PageContext.REQUEST_SCOPE);
        }
      }
      out.write("\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<title>宇晨网络新闻中心后台首页</title>\r\n</head>\r\n\r\n");

List list=(List)request.getAttribute("list");
int number=list.size();
//以下这段代码是计算多少页数
int pageNumber=number;
if(pageNumber%11==0){
pageNumber=pageNumber/11;
}else{
pageNumber=pageNumber/11+1;
}
//以下是计算当前页的页数
int count;
if(request.getParameter("count")==null){
count=0;
}else{
count=Integer.valueOf(request.getParameter("count"));
}
//以下显示多少条纪录
int start=count*11;//开始条数
int over=(count+1)*11;//结束条数
int lastCount=number-over;//还剩多少条记录
 if(lastCount<=0){
  over=number;
  }

      out.write("\r\n\r\n<body><div align=\"center\">\r\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "bTop.jsp", out, false);
      out.write("\r\n<table width=\"800\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n  <tr>\r\n    <td width=\"196\" rowspan=\"2\" valign=\"top\">");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "bleft.jsp", out, false);
      out.write("</td>\r\n    <td width=\"600\" height=\"57\" background=\"bImage/place.jpg\" ><table width=\"600\" height=\"36\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n        <tr>\r\n          <td>&nbsp;&nbsp;当前位置提示&nbsp;&gt;&gt;&nbsp;后台首页</td>\r\n        </tr>\r\n        <tr>\r\n          <td>&nbsp;</td>\r\n        </tr>\r\n      </table></td>\r\n  </tr>\r\n  <tr align=\"center\">\r\n    <td valign=\"top\" background=\"bImage/big.jpg\" >\t  <table width=\"601\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"bImage/placeNext.jpg\">\r\n        <tr>\r\n          <td height=\"21\" >&nbsp;</td>\r\n          <td>全部新闻查询</td>\r\n        </tr>\r\n      </table>\r\n\t  <br>\r\n\r\n\t  <table width=\"500\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\">\r\n      <tr>\r\n        <td width=\"54\" height=\"27\"><div align=\"center\">编号</div></td>\r\n        <td width=\"145\"><div align=\"center\">题目</div></td>\r\n        <td width=\"78\"><div align=\"center\">类别</div></td>\r\n        <td width=\"78\"><div align=\"center\">创建时间</div></td>\r\n        <td width=\"126\"><div align=\"center\">操作</div></td>\r\n      </tr>\r\n\t     ");

  for(int i=start;i<over;i++){
  NewsForm form=(NewsForm)list.get(i);
  
      out.write("\r\n      <tr>\r\n        <td width=\"54\" height=\"31\"><div align=\"center\">");
      out.print(i+1);
      out.write("</div></td>\r\n        <td width=\"145\"><div align=\"center\">");
      out.print(form.getTitle());
      out.write("</div></td>\r\n        <td width=\"85\"><div align=\"center\">");
      out.print(form.getBigSort());
      out.write("</div></td>\r\n        <td width=\"78\"><div align=\"center\">\r\n          ");
if(time.cuttentMonthDate().equals(form.getCreateTime())){
      out.write("\r\n          <b><font color=\"#0265CB\">NEW</font></b>\r\n");
}else{
      out.print(form.getCreateTime());
}
      out.write("\r\n</div></td>\r\n        <td width=\"126\"><div align=\"center\"><a href=\"newsAction.do?method=selectOneNewsAction&id=");
      out.print(form.getId());
      out.write("\">查询详细内容</a></div></td>\r\n      </tr>\r\n\t  ");
}
      out.write("\r\n    </table>\r\n\r\n\t<table width=\"95%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n      <tr align=\"center\">\r\n        <td width=\"578\" height=\"32\" >\r\n          ");
for(int i=0;i<pageNumber;i++){
      out.write("\r\n          ");
if(count==i){
      out.write("\r\n          [<font color=\"#FF0000\"><b>");
      out.print(i+1);
      out.write("</b></font>]\r\n          ");
}else{
      out.write("\r\n      [<a href=\"newsAction.do?method=selectNewsAction&count=");
      out.print(i);
      out.write("\"><b>");
      out.print(i+1);
      out.write("</b></a>]\r\n      ");
}}
      out.write("</td>\r\n      </tr>\r\n    </table></td>\r\n  </tr>\r\n</table>\r\n</div>\r\n</body>\r\n</html>\r\n");
    } 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 + -