📄 diarys_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import myTools.DataBase;
import java.sql.*;
public final class diarys_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();
private static java.util.List _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.AnnotationProcessor _jsp_annotationprocessor;
public Object getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_annotationprocessor = (org.apache.AnnotationProcessor) getServletConfig().getServletContext().getAttribute(org.apache.AnnotationProcessor.class.getName());
}
public void _jspDestroy() {
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
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 {
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("\r\n");
out.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\r\n");
out.write("\"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<link href=\"css.css\" rel=\"stylesheet\" type=\"text/css\" media=\"all\" />\r\n");
out.write("<title>个人空间--日志列表</title>\r\n");
String user_id = (String)session.getAttribute("user_id");
if(user_id == null){
System.out.println("Diarys List Page Error");
}
DataBase db = new DataBase();
ResultSet rs = null;
db.connectToDB();
String sql = "select * from diary where diarymaker_id = " + user_id;
rs = db.executeQuery(sql);
out.write("\r\n");
out.write("<form>\r\n");
out.write(" <div id=\"diarys\">\r\n");
out.write(" <div id=\"diaryshead\" align=\"\"><strong>日志列表</strong></div>\r\n");
out.write(" ");
while(rs.next()){
String diary_id = rs.getString(1);
String diarymaker_id = rs.getString(2);
String diary_title = rs.getString(3);
String diary_date = rs.getString(4).substring(0, 16);
String diary_content = rs.getString(5);
String comments_account = rs.getString(6);
String visit_account = rs.getString(7);
if(diary_content.length()>200){
diary_content = diary_content.substring(0, 199);
}
out.write("\r\n");
out.write(" <div class=\"diary\">\r\n");
out.write(" <hr>\r\n");
out.write(" <div class=\"diarytitle\">");
out.print(diary_title);
out.write("</div>\r\n");
out.write(" <div class=\"diarybody\">\r\n");
out.write(" <div>");
out.print(diary_content);
out.write("</div>\r\n");
out.write(" <div clas=\"diarycontinue\" align=\"right\"><a href=\"diary.jsp?diary_id=");
out.print(diary_id);
out.write("\">>>继续阅读</a></div>\r\n");
out.write(" </div>\r\n");
out.write(" <div>浏览(");
out.print(visit_account);
out.write(") 评论(");
out.print(comments_account);
out.write(")</div>\r\n");
out.write(" </div>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" </div>\r\n");
out.write("</form>");
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -