📄 selectsort_jsp.java
字号:
package org.apache.jsp.bSort;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.sql.*;
import java.util.List;
import com.actionForm.SortForm;
public final class selectSort_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("\r\n\r\n");
com.tool.Chinese chinese = null;
synchronized (request) {
chinese = (com.tool.Chinese) _jspx_page_context.getAttribute("chinese", PageContext.REQUEST_SCOPE);
if (chinese == null){
chinese = new com.tool.Chinese();
_jspx_page_context.setAttribute("chinese", chinese, PageContext.REQUEST_SCOPE);
}
}
out.write("\r\n<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<title>宇晨网络新闻中心后台</title>\r\n<script language=\"javascript\">\r\nfunction deleteForm(date1,date2){\r\nif(confirm(\"您真的要删除吗?\")){\r\nwindow.location.href=\"sortAction.do?method=deleteSortAction&bigSort=\"+date1+\"&id=\"+date2;\r\n}\r\n}\r\n</script>\r\n</head>\r\n");
String bigSort=chinese.toChinese(request.getParameter("bigSort"));
List list=(List)request.getAttribute("list");
int number=list.size();
//以下这段代码是计算多少页数
int pageNumber=number;
if(pageNumber%10==0){
pageNumber=pageNumber/10;
}else{
pageNumber=pageNumber/10+1;
}
//以下是计算当前页的页数
int count;
if(request.getParameter("count")==null){
count=0;
}else{
count=Integer.valueOf(request.getParameter("count"));
}
//以下显示多少条纪录
int start=count*10;//开始条数
int over=(count+1)*10;//结束条数
int lastCount=number-over;//还剩多少条记录
if(lastCount<=0){
over=number;
}
out.write("\r\n<body><div align=\"center\">\r\n");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../bTop.jsp", out, false);
out.write("\r\n<table width=\"800\" height=\"465\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tr>\r\n <td width=\"196\" rowspan=\"2\" valign=\"top\">");
org.apache.jasper.runtime.JspRuntimeLibrary.include(request, response, "../bleft.jsp", out, false);
out.write("</td>\r\n <td width=\"604\" height=\"57\" background=\"bImage/place.jpg\" >\r\n <table width=\"601\" height=\"36\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tr>\r\n <td> 当前位置提示 >> ");
out.print(bigSort);
out.write(" >> 详细类别管理</td>\r\n </tr>\r\n <tr>\r\n <td> </td>\r\n </tr>\r\n </table></td>\r\n </tr>\r\n <tr>\r\n <td height=\"400\" align=\"center\" valign=\"top\" background=\"bImage/big.jpg\"><table width=\"601\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" background=\"bImage/placeNext.jpg\">\r\n <tr>\r\n <td height=\"21\" > </td>\r\n <td>新闻类别查询</td>\r\n </tr>\r\n </table>\r\n\t ");
if(number==0){
out.write("\r\n\t <br>\r\n\t <br>\r\n\t 没有新闻详细类别!!!<br>\r\n\t <br>\r\n\t <br>\r\n <a href=\"sortAction.do?method=insertSortAction&bigSort=");
out.print(bigSort);
out.write("\">添加</a> 或者 <a href=\"newsAction.do?method=selectNewsAction&bigSort=");
out.print(bigSort);
out.write("\">返回</a>\r\n ");
}else{
out.write("\r\n <table width=\"415\" border=\"0\">\r\n <tr align=\"right\">\r\n <td><a href=\"newsAction.do?method=selectNewsAction&bigSort=");
out.print(bigSort);
out.write("\">返回</a></td>\r\n <td width=\"76\"> <a href=\"sortAction.do?method=insertSortAction&bigSort=");
out.print(bigSort);
out.write("\">添加类别</a> </td>\r\n </tr>\r\n </table>\r\n <table width=\"415\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tr>\r\n <td width=\"64\" height=\"27\"><div align=\"center\">类别编号</div></td>\r\n <td width=\"150\"><div align=\"center\">名称</div></td>\r\n <td width=\"83\"><div align=\"center\">创建时间</div></td>\r\n <td width=\"108\"><div align=\"center\">操作</div></td>\r\n </tr>\r\n ");
for(int i=start;i<over;i++){
SortForm form=(SortForm)list.get(i);
out.write("\r\n <tr align=\"center\">\r\n <td width=\"64\" height=\"31\">");
out.print(i+1);
out.write("</td>\r\n <td width=\"150\">");
out.print(form.getSmallSort());
out.write("</td>\r\n <td width=\"83\">");
out.print(form.getCreateTime());
out.write("</td>\r\n <td width=\"108\"><a href=\"sortAction.do?method=selectOneAction&smallSort=");
out.print(form.getSmallSort());
out.write("\">修改</a> <a href=\"javascript:deleteForm('");
out.print(bigSort);
out.write('\'');
out.write(',');
out.write('\'');
out.print(form.getId());
out.write("')\">删除</a></td>\r\n </tr>\r\n ");
}
out.write("\r\n </table>\r\n ");
}
out.write("\r\n <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tr align=\"center\">\r\n <td width=\"578\" height=\"37\" >\r\n ");
for(int i=0;i<pageNumber;i++){
out.write("\r\n ");
if(count==i){
out.write("\r\n [<font color=\"#FF0000\"><b>");
out.print(i+1);
out.write("</b></font>]\r\n ");
}else{
out.write("\r\n [<a href=\"sortAction.do?method=selectSortAction&bigSort=");
out.print(bigSort);
out.write("&count=");
out.print(i);
out.write("\"><b>");
out.print(i+1);
out.write("</b></a>]\r\n ");
}}
out.write("</td>\r\n </tr>\r\n </table></td>\r\n </tr>\r\n</table>\r\n</div>\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 + -