display_jsp.java
字号:
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import shen.*;
import java.sql.*;
import java.util.*;
public final class display_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=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\r\n\r\n<html>\r\n <head>\r\n\r\n <title>无标题文档</title>\r\n </head>\r\n ");
ArrayList list=new ArrayList();
DbConn dbconn1=new DbConn();
Connection conn1=dbconn1.getConn();
FirstDao firstdao=new FirstDao();
firstdao.setConn(conn1);
list=firstdao.select();
//第二个
DbConn dbconn2=new DbConn();
Connection conn2=dbconn2.getConn();
String strParentId = request.getParameter("parentId");
//转int
ArrayList list2 = null;
if (strParentId != null && strParentId.trim().length() != 0) {
SecondDao seconddao=new SecondDao();
seconddao.setConn(conn2);
int parentId=Integer.parseInt(strParentId);
list2 = seconddao.select(parentId);
}
out.write("\r\n <body>\r\n\r\n <table width=\"699\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\">\r\n <!--DWLayoutTable-->\r\n <tr>\r\n <td width=\"699\" height=\"133\"><h1>新闻发布前端</h1></td>\r\n </tr>\r\n </table>\r\n <table width=\"699\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\">\r\n <!--DWLayoutTable-->\r\n <tr>\r\n <td width=\"153\" height=\"538\" valign=\"top\"><!--下面table里面是新闻分类-->\r\n <table>\r\n <tr>\r\n <td>新闻分类</td>\r\n </tr>\r\n\r\n ");
for(int i=0;i<list.size();i++)
{
out.write("\r\n <tr>\r\n <td>\r\n ");
FirstBean bean=(FirstBean)list.get(i);
out.write("\r\n <a href=\"display.jsp?parentId=");
out.print(bean.getId());
out.write('"');
out.write('>');
out.print(bean.getTitleName());
out.write("</a>\r\n </td>\r\n\r\n </tr>\r\n ");
}
out.write("\r\n\r\n </table>\r\n </td>\r\n\r\n <td width=\"546\"><!--下面table是新闻的内容-->\r\n\r\n <table>\r\n <tr><td><h3><a href=\"moredisplay.jsp?parentId=");
out.print(request.getParameter("parentId"));
out.write("\">更多新闻</a></h3><br><td></tr>\r\n <tr>\r\n <td>\r\n ");
if (strParentId != null && strParentId.trim().length() != 0)
for(int i=0;i<list2.size();i++)
{
SecondBean secondbean=(SecondBean)list2.get(i);
out.write("\r\n <a href=\"content.jsp?id=");
out.print(secondbean.getId());
out.write('"');
out.write(' ');
out.write('>');
out.print(secondbean.getTitleName());
out.write("</a><br>\r\n ");
}
out.write("\r\n </td>\r\n </tr>\r\n </table>\r\n\r\n </td>\r\n </tr>\r\n </table>\r\n </body>\r\n </html>\r\n\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 + -