• 大小: 2.69MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-11
  • 语言: Java
  • 标签: jsp+servlet  

资源简介

Java Web 新闻网页制作源代码,自己做的网页

资源截图

代码片段和文件信息

package com.action;
/**
 * 管理员登陆 增加 修改 删除 删除登陆日志
 */
import java.io.IOException;
import java.util.List;
import java.util.StringTokenizer;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.bean.AdminBean;
import com.bean.SystemBean;
import com.util.Constant;
import com.util.MD5;

public class AdminServlet extends HttpServlet {

/**
 * Constructor of the object.
 */
public AdminServlet() {
super();
}

/**
 * Destruction of the servlet. 

 */
public void destroy() {
super.destroy(); // Just puts “destroy“ string in log
// Put your code here
}

/**
 * The doGet method of the servlet. 

 *
 * This method is called when a form has its tag value method equals to get.
 * 
 * @param request the request send by the client to the server
 * @param response the response send by the server to the client
 * @throws ServletException if an error occurred
 * @throws IOException if an error occurred
 */
public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {

doPost(requestresponse);
}

/**
 * The doPost method of the servlet. 

 *
 * This method is called when a form has its tag value method equals to post.
 * 
 * @param request the request send by the client to the server
 * @param response the response send by the server to the client
 * @throws ServletException if an error occurred
 * @throws IOException if an error occurred
 */
public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {

response.setContentType(Constant.CONTENTTYPE);
request.setCharacterEncoding(Constant.CHARACTERENCODING);
try{
String method=request.getParameter(“method“).trim();
AdminBean loginbean = new AdminBean();
HttpSession session = request.getSession();
session.setMaxInactiveInterval(1200);
SystemBean systembean = new SystemBean();
String sysdir = systembean.getDir();
if(method.equals(“one“)){//admin登录
String username = request.getParameter(“username“);
String password = request.getParameter(“password“);
if(username == null||username.trim().equals(““)){
request.setAttribute(“message“ “请正确输入用户名!“);
request.getRequestDispatcher(sysdir+“/login.jsp“).forward(request response);
}
else if(password == null||password.trim().equals(““)){
request.setAttribute(“message“ “请输入密码!“);
request.getRequestDispatcher(sysdir+“/login.jsp“).forward(request response);
}
else{
String md5password = MD5.MD5(password);
String agent = request.getHeader(“user-agent“); 
StringTokenizer st = new StringTokenizer(agent“;“); 
String useros=st.nextToken();
String loginip = request.getRemot

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-04-22 15:47  jsp+servlet+javabean实现的新闻发布系统\
     目录           0  2015-04-22 15:49  jsp+servlet+javabean实现的新闻发布系统\xwfb\
     文件         788  2015-04-22 15:54  jsp+servlet+javabean实现的新闻发布系统\xwfb\.classpath
     目录           0  2015-04-22 19:20  jsp+servlet+javabean实现的新闻发布系统\xwfb\.myeclipse\
     文件         285  2015-04-22 15:49  jsp+servlet+javabean实现的新闻发布系统\xwfb\.mymetadata
     文件        1747  2015-04-22 15:50  jsp+servlet+javabean实现的新闻发布系统\xwfb\.project
     目录           0  2015-04-22 15:50  jsp+servlet+javabean实现的新闻发布系统\xwfb\.settings\
     文件         500  2015-04-22 15:50  jsp+servlet+javabean实现的新闻发布系统\xwfb\.settings\.jsdtscope
     文件         334  2015-04-22 15:49  jsp+servlet+javabean实现的新闻发布系统\xwfb\.settings\org.eclipse.jdt.core.prefs
     文件         450  2015-04-22 15:49  jsp+servlet+javabean实现的新闻发布系统\xwfb\.settings\org.eclipse.wst.common.component
     文件         252  2015-04-22 15:50  jsp+servlet+javabean实现的新闻发布系统\xwfb\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2015-04-22 15:50  jsp+servlet+javabean实现的新闻发布系统\xwfb\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2015-04-22 15:50  jsp+servlet+javabean实现的新闻发布系统\xwfb\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件        5632  2012-06-03 23:47  jsp+servlet+javabean实现的新闻发布系统\xwfb\Thumbs.db
     目录           0  2015-04-22 15:41  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\
     目录           0  2015-04-22 15:41  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\
     文件         835  2012-06-09 08:11  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\default.jsp
     目录           0  2015-04-22 15:41  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\
     目录           0  2015-04-22 15:41  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\
     目录           0  2015-04-22 15:41  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\
     文件        3875  2012-06-08 15:44  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckcontextmenu.js
     文件        1422  2012-06-08 00:45  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckdocumentfragment_gecko.js
     文件        1728  2012-06-08 08:43  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckdocumentfragment_ie.js
     文件       12153  2012-06-04 05:17  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckdomrange.js
     文件        2032  2012-06-09 02:11  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckdomrange_gecko.js
     文件        4460  2012-06-04 02:40  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckdomrange_ie.js
     文件        7691  2012-06-07 05:39  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckeditingarea.js
     文件        1517  2012-06-07 21:40  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckelementpath.js
     文件       16356  2012-06-02 03:55  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckenterkey.js
     文件        1414  2012-06-04 18:10  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckevents.js
     文件        2980  2012-06-10 12:53  jsp+servlet+javabean实现的新闻发布系统\xwfb\WebRoot\FCKeditor\editor\_source\classes\fckicon.js
............此处省略735个文件信息

评论

共有 条评论