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

📄 shownote_jsp.java

📁 用jsp实现在线留言!采用MVC三层架构!
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package org.apache.jsp;

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

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

 String Board_Name,Board_Id,Note_Id;
  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,
      			"err.jsp", 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("<link rel='stylesheet' type='text/css' href='inc/FORUM.CSS'>\r\n");
      out.write("<META NAME=\"keywords\" CONTENT=\"溢洋 溢洋论坛 xyworker@163.com java forum jsp forum\">\r\n");
      out.write("<META NAME=\"description\" CONTENT=\"溢洋 溢洋论坛 xyworker@163.com java forum jsp forum\">\r\n");
      out.write("<script language=\"JavaScript\">\r\n");
      out.write("function Popup(url, window_name, window_width, window_height)\r\n");
      out.write("{ settings=\r\n");
      out.write("\"toolbar=no,location=no,directories=no,\"+\r\n");
      out.write("\"status=no,menubar=no,scrollbars=yes,\"+\r\n");
      out.write("\"resizable=yes,width=\"+window_width+\",height=\"+window_height;\r\n");
      out.write("\r\n");
      out.write("NewWindow=window.open(url,window_name,settings); }\r\n");
      out.write("\r\n");
      out.write("function icon(theicon) {\r\n");
      out.write("document.input.message.value += \" \"+theicon;\r\n");
      out.write("document.input.message.focus();\r\n");
      out.write("}\r\n");
      out.write("</script>\r\n");
      out.write("\r\n");
      out.write("<title>同升论谈</title>\r\n");
      out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n");
      out.write("</head>\r\n");
      out.write("<body text=\"#0000ff\" >\r\n");
      org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "inc/public.jsp", out, true);
      out.write("\r\n");
      out.write("<table width=\"760\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">\r\n");
      out.write("<tr>\r\n");
      yy.jdbc yy = null;
      synchronized (_jspx_page_context) {
        yy = (yy.jdbc) _jspx_page_context.getAttribute("yy", PageContext.PAGE_SCOPE);
        if (yy == null){
          yy = new yy.jdbc();
          _jspx_page_context.setAttribute("yy", yy, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      yy.bbcode li = null;
      synchronized (_jspx_page_context) {
        li = (yy.bbcode) _jspx_page_context.getAttribute("li", PageContext.PAGE_SCOPE);
        if (li == null){
          li = new yy.bbcode();
          _jspx_page_context.setAttribute("li", li, PageContext.PAGE_SCOPE);
        }
      }
      out.write('\r');
      out.write('\n');
      out.write('\r');
      out.write('\n');

    Board_Id=request.getParameter("fid");
    Note_Id=request.getParameter("noteid");
    Connection con=yy.getConn();
    Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    ResultSet rs=null;
    String sql="Select 论坛名称 from 论坛栏目 Where 论坛id="+Board_Id;
    rs=stmt.executeQuery(sql);
    while(rs.next())
    {
      Board_Name=rs.getString("论坛名称");
    }

      out.write("\r\n");
      out.write("\t<td width=\"62%\"> <a href=\"../default1.jsp\">首页</a>&gt;&gt;<a href=\"index.jsp\">溢洋论坛</a>&gt;&gt;<a href=board.jsp?fid=");
      out.print(Board_Id);
      out.write('>');
      out.print(Board_Name);
      out.write("</a>&gt;&gt;浏览贴子\r\n");
      out.write("    </td>\r\n");
      out.write("    <td class=\"post\" align=\"right\" width=\"38%\"> <a href=\"post.jsp?fid=");
      out.print(Board_Id);
      out.write("\"><img src=\"IMAGES/TOPIC.GIF\" border=\"0\"></a>&nbsp;<a href=\"post.jsp?fid=");
      out.print(Board_Id);
      out.write("&Returnid=");
      out.print(Note_Id);
      out.write("\"><img src=\"IMAGES/REPLY.GIF\"  border=\"0\" ></a>&nbsp;<a href='javascript:print()'><img src=\"IMAGES/PRINT.GIF\"  border=\"0\" ></a></td>\r\n");
      out.write("  </tr></table>\r\n");
      out.write("\r\n");
      out.write("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"754\" align=\"center\">\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("<tr>\r\n");
      out.write("  <td bgcolor=\"#009ACE\">\r\n");
      out.write("      <table border=\"0\" cellspacing=\"1\" cellpadding=\"6\" width=\"100%\">\r\n");
      out.write("        ");

       sql="update 贴子 set 点击次数=点击次数+1 where 贴子id="+Note_Id;
       stmt.executeUpdate(sql);
       int PageSize=10;
       int RecordCount=0;
       int PageCount=0;
       int ShowPage=1;
       sql="Select * from 用户表,贴子 where 贴子.贴子作者=用户表.用户名  And 贴子.贴子id="+Note_Id+" And 版块id="+Board_Id+" or 贴子.贴子作者=用户表.用户名  And 贴子.回复id="+Note_Id+" And 版块id="+Board_Id+"  order by 贴子.贴子id";
       //out.println(sql);
	   rs=stmt.executeQuery(sql);
       rs.last();
       RecordCount=rs.getRow();
       PageCount=(RecordCount % PageSize==0)?(RecordCount/PageSize):(RecordCount/PageSize+1);
       String Page=request.getParameter("page");
       if (Page!=null)
       {
             ShowPage=Integer.parseInt(Page);
          if (ShowPage>PageCount)
             ShowPage=PageCount;
          else if(ShowPage<0)
             ShowPage=1;
       }else
             ShowPage=1;

     if (RecordCount>0)
     {
     rs.absolute((ShowPage-1)*PageSize+1);
     for (int i=1;i<PageSize;i++)
{
    String Note_Title=rs.getString("贴子名称");
    String User_Name=rs.getString("用户名");
    String Noteall_Id=rs.getString("贴子id");
    String User_Level=rs.getString("用户等级");
    String Sing_Id=rs.getString("显示签名");

      out.write("\r\n");
      out.write("\r\n");
      out.write("        <tr>\r\n");
      out.write("          <td width=\"22%\" bgcolor=\"#9CCFFF\">作者 </td>\r\n");
      out.write("          <td bgcolor=\"#9CCFFF\">文章标题 <span class=\"postauthor\">");
      out.print(Note_Title);
      out.write("</span></td>\r\n");
      out.write("      </tr>\r\n");
      out.write("        <tr>\r\n");
      out.write("          <td rowspan=\"3\" valign=\"top\" bgcolor=\"#F7FBFF\"> <span class=\"postauthor\">");
      out.print(User_Name);

⌨️ 快捷键说明

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