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

📄 browse_jsp.java

📁 JSP版的在线相册系统
💻 JAVA
字号:
package org.apache.jsp;

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

public final class browse_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("\n<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\n<title>浏览图片</title>\n <style type=\"text/css\">\n<!--\nbody {\n\tbackground-color: #FFFFCC;\n}\n.style1 {font-size: 12px}\n.style2 {\n\tfont-size: 16px;\n\tcolor: #FF0000;\n}\n-->\n</style>\n</head>\n\n\n<body>\n  ");
      photo.DBConnection dbconn = null;
      synchronized (_jspx_page_context) {
        dbconn = (photo.DBConnection) _jspx_page_context.getAttribute("dbconn", PageContext.PAGE_SCOPE);
        if (dbconn == null){
          dbconn = new photo.DBConnection();
          _jspx_page_context.setAttribute("dbconn", dbconn, PageContext.PAGE_SCOPE);
        }
      }
      out.write("\n <p align=\"center\" class=\"style2\">点击图片可以查看大图并对图片发表评论</p>\n<table width=\"100\"  border=\"0\" align=\"center\" >\n  <tr>\n   ");
try{Connection conn=dbconn.getConnection();Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);String sql="select * from pictures";ResultSet rs=stmt.executeQuery(sql);int k=0; while(rs.next()){  // int j=rs.getRow();   int i=rs.getInt("picture_id");   String title=rs.getString("picture_title");   if(k%2==0)       out.println("</tr>");
      out.write("<td>\n        <table width=\"333\"  border=\"0\">\n            <tr>\n                <td height=\"26\" colspan=\"2\">标题:");
      out.print(title);
      out.write("</td>\n            </tr>\n            <tr>\n\n                <td width=\"139\" height=\"150\" rowspan=\"2\"><a href=\"pic_detail.jsp?picture_id=");
      out.print(i);
      out.write("\"><img src=\"pic_show.jsp?picture_id=");
      out.print(i);
      out.write("\" width=\"130\" height=\"150\" border=\"0\" alt=\"\"></a></td>\n                <td width=\"178\" height=\"60\">\n\n                </td>\n            </tr>\n            <tr>\n                <td height=\"60\"><p>上传时间:");
      out.print(rs.getString("upload_time"));
      out.write("</p>\n                <p>上传用户:");
      out.print(rs.getString("user_name"));
      out.write("</p></td>\n            </tr>\n        </table> </td>\n\n ");
 k++; }
      out.write("\n\n</table>\n");
 rs.close();  stmt.close();  conn.close(); }  catch(Exception e){e.printStackTrace();}  
      out.write("\n  </body>\n\n</html>\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 + -