📄 _shownews__jsp.java
字号:
/*
* JSP generated by Resin-3.1.0 (built Fri, 22 Dec 2006 07:00:35 PST)
*/
package _jsp._news;
import javax.servlet.*;
import javax.servlet.jsp.*;
import javax.servlet.http.*;
import java.text.*;
import java.util.Date;
import java.util.*;
import java.lang.*;
import java.io.*;
import news.*;
import newscomm.*;
public class _shownews__jsp extends com.caucho.jsp.JavaPage
{
private final java.util.HashMap<String,java.lang.reflect.Method> _jsp_functionMap = new java.util.HashMap<String,java.lang.reflect.Method>();
private boolean _caucho_isDead;
public final int MaxPerPage = 20; //\u6bcf\u9875\u4fe1\u606f\u4e2a\u6570
public String IMG_SITE;
public String IMG_LABLE_F = "<P[space]align=center><IMG[space]SRC=";
public String IMG_LABLE_L = "></P><p>";
public String strBG1="#FFFFFF";
public String strBG2="#FEEC85";
public String strbg;
//\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u7b26
public static String replaceString(String origStr, String oldStr, String newStr) {
if (origStr == null || origStr.length() == 0 || oldStr == null ||
oldStr.length() == 0 || newStr == null) {
return origStr;
}
StringBuffer buffer = new StringBuffer();
// find the oldStr's place in origStr
while (origStr.indexOf(oldStr) != -1) {
int index = origStr.indexOf(oldStr);
buffer.append(origStr.substring(0, index));
buffer.append(newStr);
origStr = origStr.substring(index+oldStr.length());
}
buffer.append(origStr);
return buffer.toString();
}
// \u5224\u65ad\u662f\u5426\u4e3a\u65b0\u4fe1\u606f
boolean isNew(String adate)
{
Calendar c=Calendar.getInstance();
SimpleDateFormat thismonth = new SimpleDateFormat("yyyy-MM-dd");
c.add(Calendar.DATE, -3);
String slastday=thismonth.format(c.getTime());
if(slastday.compareTo(adate) <=0) return true;
else return false;
}
public String getName(String Userid)throws Exception
{
try{
User o_user = new User();
o_user.setUserName(Userid);
if(o_user.getUser())
{
return o_user.getEmpName();
}
}catch(Exception e)
{System.out.println(e.toString());}
return "";
}
// \u5224\u65ad\u7528\u6237\u662f\u5426\u5b58\u5728
public boolean IsUser(String userid,String passwd)throws Exception
{
try{
if(userid.length()==0 || passwd.length()==0)
return false;
else{
// \u5b9a\u4e49\u7528\u6237\u5bf9\u8c61\uff0c\u8bbe\u7f6e\u5176\u7528\u6237\u540d\u548c\u5bc6\u7801
User o_user = new User();
o_user.setUserName(userid);
o_user.setUserPwd(passwd);
// \u5224\u65ad\u662f\u5426\u5b58\u5728\u6b64\u7528\u6237\u4fe1\u606f\uff0c\u5982\u679c\u5b58\u5728\u6b64\u7528\u6237\u5219\u8fd4\u56detrue
if(o_user.getUser())
{
return true;
}
}
}catch(Exception e){
e.printStackTrace();
}
return false;
}
// \u5224\u65ad\u7528\u6237\u7c7b\u578b
public int getType(String userid)throws Exception
{
try{
if(userid.length()==0)
return 0;
else{
// \u5b9a\u4e49\u7528\u6237\u5bf9\u8c61\uff0c\u8bbe\u7f6e\u5176\u7528\u6237\u540d\u548c\u5bc6\u7801
User o_user = new User();
o_user.setUserName(userid);
// \u5224\u65ad\u662f\u5426\u5b58\u5728\u6b64\u7528\u6237\u4fe1\u606f\uff0c\u5982\u679c\u5b58\u5728\u6b64\u7528\u6237\u5219\u8fd4\u56detrue
if(o_user.getUser())
return o_user.getUserType();
}
}catch(Exception e){
e.printStackTrace();
}
return 0;
}
String strTitle,sDatetime,strContent,sPoster;
Date dNews;
Vector v_News;
int iHits,iattpic,NewsId;
public void
_jspService(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException
{
javax.servlet.http.HttpSession session = request.getSession(true);
com.caucho.server.webapp.WebApp _jsp_application = _caucho_getApplication();
javax.servlet.ServletContext application = _jsp_application;
com.caucho.jsp.PageContextImpl pageContext = com.caucho.jsp.QJspFactory.allocatePageContext(this, _jsp_application, request, response, null, session, 8192, true, false);
javax.servlet.jsp.JspWriter out = pageContext.getOut();
final javax.el.ELContext _jsp_env = pageContext.getELContext();
javax.servlet.ServletConfig config = getServletConfig();
javax.servlet.Servlet page = this;
response.setContentType("text/html;charset=gb2312");
request.setCharacterEncoding("GB2312");
try {
out.write(_jsp_string0, 0, _jsp_string0.length);
IMG_SITE = "/servlet/news.ReadImage?ImgId=";
out.write(_jsp_string1, 0, _jsp_string1.length);
try
{
// \u53d6\u5f97\u4fe1\u606f\u7f16\u53f7
NewsId = Integer.parseInt(request.getParameter("id"));
// \u5b9a\u4e49\u65b0\u7684\u4fe1\u606f\u5bf9\u8c61\uff0c\u8bbe\u7f6e\u4fe1\u606f\u7f16\u53f7\uff0c\u4ee5\u83b7\u5f97\u6b64\u4fe1\u606f
News o_New = new News();
o_New.setNewsId(NewsId);
if(o_New.getNews())
{
// \u53d6\u4fe1\u606f\u5185\u5bb9
strTitle = o_New.getTitle();
iHits = o_New.getHits();
sDatetime = o_New.getPostTime();
sPoster = o_New.getPoster();
iattpic = o_New.getAttpic();
strContent = o_New.getContent();
// \u66ff\u6362\u5185\u5bb9\u4e2d\u7684\u5b57\u7b26\u4e32
strContent = replaceString(strContent,"[space]"," ");
}//end if
iHits++;
// \u66f4\u65b0\u9605\u8bfb\u6b21\u6570
o_New.UpdateHits(iHits);
}
catch(Exception e)
{ System.out.println(e.toString());}
out.write(_jsp_string2, 0, _jsp_string2.length);
out.print((strTitle));
if (iattpic==1){
out.write(_jsp_string3, 0, _jsp_string3.length);
}
out.write(_jsp_string4, 0, _jsp_string4.length);
out.print((strContent));
out.write(_jsp_string5, 0, _jsp_string5.length);
out.print((sDatetime));
out.write(_jsp_string6, 0, _jsp_string6.length);
out.print((iHits));
out.write(_jsp_string7, 0, _jsp_string7.length);
} catch (java.lang.Throwable _jsp_e) {
pageContext.handlePageException(_jsp_e);
} finally {
com.caucho.jsp.QJspFactory.freePageContext(pageContext);
}
}
private java.util.ArrayList _caucho_depends = new java.util.ArrayList();
public java.util.ArrayList _caucho_getDependList()
{
return _caucho_depends;
}
public void _caucho_addDepend(com.caucho.vfs.PersistentDependency depend)
{
super._caucho_addDepend(depend);
com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
}
public boolean _caucho_isModified()
{
if (_caucho_isDead)
return true;
if (com.caucho.server.util.CauchoSystem.getVersionId() != 5022137076587403036L)
return true;
for (int i = _caucho_depends.size() - 1; i >= 0; i--) {
com.caucho.vfs.Dependency depend;
depend = (com.caucho.vfs.Dependency) _caucho_depends.get(i);
if (depend.isModified())
return true;
}
return false;
}
public long _caucho_lastModified()
{
return 0;
}
public java.util.HashMap<String,java.lang.reflect.Method> _caucho_getFunctionMap()
{
return _jsp_functionMap;
}
public void init(ServletConfig config)
throws ServletException
{
super.init(config);
com.caucho.server.webapp.WebApp webApp
= (com.caucho.server.webapp.WebApp) config.getServletContext();
com.caucho.jsp.TaglibManager manager = webApp.getJspApplicationContext().getTaglibManager();
}
public void destroy()
{
_caucho_isDead = true;
super.destroy();
}
public void init(com.caucho.vfs.Path appDir)
throws javax.servlet.ServletException
{
com.caucho.vfs.Path resinHome = com.caucho.server.util.CauchoSystem.getResinHome();
com.caucho.vfs.MergePath mergePath = new com.caucho.vfs.MergePath();
mergePath.addMergePath(appDir);
mergePath.addMergePath(resinHome);
com.caucho.loader.DynamicClassLoader loader;
loader = (com.caucho.loader.DynamicClassLoader) getClass().getClassLoader();
String resourcePath = loader.getResourcePathSpecificFirst();
mergePath.addClassPath(resourcePath);
com.caucho.vfs.Depend depend;
depend = new com.caucho.vfs.Depend(appDir.lookup("news/ShowNews.jsp"), 4969080647910696742L, false);
com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
depend = new com.caucho.vfs.Depend(appDir.lookup("news/admin/NewsComm.jsp"), 7147789067385854643L, false);
com.caucho.jsp.JavaPage.addDepend(_caucho_depends, depend);
}
private final static char []_jsp_string3;
private final static char []_jsp_string6;
private final static char []_jsp_string0;
private final static char []_jsp_string5;
private final static char []_jsp_string7;
private final static char []_jsp_string2;
private final static char []_jsp_string1;
private final static char []_jsp_string4;
static {
_jsp_string3 = "(\u9644\u56fe)".toCharArray();
_jsp_string6 = "</font></td>\r\n<td width='33%' style='FONT-SIZE: 9pt' align=center bgcolor=#ffffff><font color=#336699>\u9605\u8bfb\u6b21\u6570\uff1a".toCharArray();
_jsp_string0 = " \r\n\r\n\r\n".toCharArray();
_jsp_string5 = "</td></tr>\r\n\r\n<tr>\r\n<td><table width=\"100%\">\r\n<tr>\r\n<td width='67%' style='FONT-SIZE: 9pt' align=center bgcolor=#ffffff><font color=#336699>\u52a0\u5165\u65f6\u95f4\uff1a".toCharArray();
_jsp_string7 = "</font></td></tr>\r\n</table></td></tr>\r\n</table></center></div>\r\n<br>\r\n<p align=center><a href=\"javascript:window.close();\">[\u5173\u95ed]</a>\r\n</BODY>\r\n</HTML>".toCharArray();
_jsp_string2 = "\r\n<div align=center><center>\r\n<table width='600' cellspacing=1 cellpadding=4>\r\n\r\n<tr><td width='100%' align=center bgcolor=#ffffff colspan=3><strong><font color=black size=3>\r\n".toCharArray();
_jsp_string1 = "\r\n\r\n<html>\r\n<head>\r\n<title>\u65b0\u95fb\u8be6\u7ec6\u5185\u5bb9</title>\r\n<meta HTTP-EQUIV=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<link rel=\"stylesheet\" href=\"style.css\">\r\n</head>\r\n<body>\r\n".toCharArray();
_jsp_string4 = "</font></strong></td></tr>\r\n<tr><td bgcolor=#ffffff colspan=3 width='100%'><hr color='green'><td></tr>\r\n<tr><td width=\"100%\" style='FONT-SIZE: 9pt'>".toCharArray();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -