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

📄 newspre_jsp.java

📁 源码新闻发布系统
💻 JAVA
字号:
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.sql.*;
import java.sql.*;

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

Connection con=null; 
Connection conn=null; 
  private static java.util.Vector _jspx_dependants;

  static {
    _jspx_dependants = new java.util.Vector(3);
    _jspx_dependants.add("/newpreleft.jsp");
    _jspx_dependants.add("/newsleft.html");
    _jspx_dependants.add("/mainnews.jsp");
  }

  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=GBK");
      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\r\n<html>\r\n<head>\r\n<title>新闻发布系统</title>\r\n</head>\r\n<body>\r\n<table width=\"1000\" border=\"0\" align=\"center\">\r\n  <tr>\r\n    <td height=\"86\" width=\"700\" colspan=\"2\"><img alt=\"\" src=\"head.gif\"></td>\r\n  </tr>\r\n  <tr>\r\n    <td width=\"105\" height=\"530\" valign=\"top\" bgcolor=\"ff00ff\" rowspan=\"2\">");
      out.write("\r\n\r\n");
      newsreleasesystem.SQLBean sqlb = null;
      synchronized (session) {
        sqlb = (newsreleasesystem.SQLBean) _jspx_page_context.getAttribute("sqlb", PageContext.SESSION_SCOPE);
        if (sqlb == null){
          sqlb = new newsreleasesystem.SQLBean();
          _jspx_page_context.setAttribute("sqlb", sqlb, PageContext.SESSION_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      out.write("\r\n<html>\r\n<head>\r\n<title>\r\nnewpreleft\r\n</title>\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n");
      out.write("<html>\n<head>\n</head>\n<body>\n<center>\n<img alt=\"\" src=\"left.jpg\"/>\n</center>\n</body>\n</html>\n");
      out.write("\r\n<h3 align=\"center\">\r\n新闻分类\r\n</h3>\r\n<div align=\"center\">\r\n");

try {
  if(sqlb.getCon()!=null){
    con=sqlb.getCon();
    String strSql="select * from FirstLevelTitle";
    Statement stmt=con.createStatement();
    ResultSet rs=stmt.executeQuery(strSql);
    while(rs.next()){
      out.write("\r\n    <p><a href=\"\" target=\"newspremainframe\">");
      out.print(rs.getString(2) );
      out.write("</a></p>\r\n    ");
}
    rs.close();
    stmt.close();
    con.close();
  }
}
catch (Exception ex) {
  System.out.println(ex.getMessage());
}

      out.write("\r\n</div>\r\n</body>\r\n</html>\r\n");
      out.write("</td>\r\n    <td width=\"900\" height=\"20\" bgcolor=\"ff00ff\" align=\"center\" valign=\"top\">Welcome to this news station!</td>\r\n  </tr>\r\n  <tr>\r\n    <td height=\"520\" valign=\"top\">");
      out.write("\r\n\r\n");
      newsreleasesystem.SQLBean sqlcb = null;
      synchronized (session) {
        sqlcb = (newsreleasesystem.SQLBean) _jspx_page_context.getAttribute("sqlcb", PageContext.SESSION_SCOPE);
        if (sqlcb == null){
          sqlcb = new newsreleasesystem.SQLBean();
          _jspx_page_context.setAttribute("sqlcb", sqlcb, PageContext.SESSION_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      out.write("\r\n<html>\r\n<head>\r\n<title>\r\nmainnews\r\n</title>\r\n</head>\r\n<body bgcolor=\"#ffffff\">\r\n<ul>\r\n");

try {
  if(sqlcb.getCon()!=null){
  conn=sqlcb.getCon();
  String strSql="select * from SecondLevelTitle";
  Statement stmt=conn.createStatement();
  ResultSet rs=stmt.executeQuery(strSql);
  while(rs.next()){
      out.write("\r\n    <li><a href=\"");
      out.print(rs.getString(3) );
      out.write('"');
      out.write('>');
      out.print(rs.getString(2) );
      out.write("</a></li>\r\n  ");
}
}
}
catch (Exception ex) {
  System.out.println(ex.getMessage());
}

      out.write("\r\n</ul>\r\n</body>\r\n</html>\r\n");
      out.write("</td>\r\n  </tr>\r\n</table>\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 + -