资源简介
BBS论坛留言板,改进版。BBS论坛留言板,改进版。BBS论坛留言板,改进版。

代码片段和文件信息
package action;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import dbUtils.DBUtils;
import entity.Message;
public class LoginAction extends HttpServlet {
/**
* Constructor of the object.
*/
public LoginAction() {
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 {
response.setContentType(“text/html;charset=UTF-8“);
request.setCharacterEncoding(“UTF-8“);
String username = request.getParameter(“username“);
String password = request.getParameter(“password“);
//System.out.println(username+“:“+password);
HttpSession session = request.getSession();
//request.setAttribute(“username“ username);
session.setAttribute(“username“ username);
System.out.println(session.getAttribute(“username“));
DBUtils.getConn();
Integer temp = DBUtils.getAUser(username password);
if(temp!=null){
List list = DBUtils.getAllMessage();
session.setAttribute(“messageList“ list);
//System.out.println(list.listIterator());
/*Message m = list.get(0);
System.out.println(m.getContent()+“*************“);*/
response.sendRedirect(“home.jsp“);
}
response.setContentType(“text/html“);
PrintWriter out = response.getWriter();
out.println(““);
out.println(““);
out.println(“ tle>A Servlet tle>“);
out.println(“ “);
out.println(“请输入正确的用户名和密码! “);
out.println(“ “);
out.println(““);
out.flush();
out.close();
}
/**
* 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 {
doGet(request
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-06-19 15:12 BBS\
目录 0 2017-06-19 15:12 BBS\BBs\
文件 2940 2017-06-15 15:36 BBS\bbs.sql
文件 1186 2017-06-11 09:36 BBS\BBs\.classpath
文件 1328 2017-06-11 09:56 BBS\BBs\.project
目录 0 2017-06-19 15:12 BBS\BBs\.settings\
文件 522 2017-06-11 09:24 BBS\BBs\.settings\.jsdtscope
文件 364 2017-06-11 09:24 BBS\BBs\.settings\org.eclipse.jdt.core.prefs
文件 468 2017-06-11 09:24 BBS\BBs\.settings\org.eclipse.wst.common.component
文件 414 2017-06-11 09:24 BBS\BBs\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-06-11 09:24 BBS\BBs\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-06-11 09:24 BBS\BBs\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2017-06-19 15:12 BBS\BBs\src\
目录 0 2017-06-19 15:12 BBS\BBs\src\action\
文件 3708 2017-06-12 10:54 BBS\BBs\src\action\LoginAction.java
文件 4225 2017-06-15 15:33 BBS\BBs\src\action\MessageAction.java
文件 3176 2017-06-12 11:01 BBS\BBs\src\action\RegisterAction.java
目录 0 2017-06-19 15:12 BBS\BBs\src\dbUtils\
文件 5143 2017-06-15 15:36 BBS\BBs\src\dbUtils\DBUtils.java
目录 0 2017-06-19 15:12 BBS\BBs\src\entity\
文件 866 2017-06-15 15:04 BBS\BBs\src\entity\Message.java
文件 492 2017-06-11 09:45 BBS\BBs\src\entity\User.java
目录 0 2017-06-19 15:12 BBS\BBs\WebRoot\
文件 1175 2017-06-15 15:08 BBS\BBs\WebRoot\addMessage.jsp
文件 1767 2017-06-15 15:35 BBS\BBs\WebRoot\home.jsp
文件 834 2017-06-11 09:24 BBS\BBs\WebRoot\index.jsp
文件 2041 2017-06-12 10:40 BBS\BBs\WebRoot\login.jsp
目录 0 2017-06-19 15:12 BBS\BBs\WebRoot\me
文件 39 2017-06-11 09:24 BBS\BBs\WebRoot\me
文件 1976 2017-06-12 10:49 BBS\BBs\WebRoot\register.jsp
文件 876 2017-06-11 12:07 BBS\BBs\WebRoot\regSuccess.jsp
............此处省略15个文件信息
相关资源
- 基于MVC模式的校园BBS系统的设计与实
- 在热力学极限下大中心电荷
- web bbs论坛
- BBS.zip
- BBS论坛的详细设计
- 14章9题 GibbsLDA++-0.2 VS2015工程
- 北大青鸟实战项目之-bbs论坛,设计思
- BBS论坛\\BBS论坛系统设计与实现论文
- 01BBS论坛系统.rar
- bbs论坛模板
- struts2做的BBS网站源代码
- 基于SSH框架的BBS论坛
- BBS论坛系统—UML课程设计代码+mdl+报告
- [bbs.itzmx.com]蜗牛发包.rar
- 用myeclipse实现的BBS论坛源码
- 大气科学Atmospheric Science An Introductor
- bbs论坛源码 数据库 静态页面
- SSH的BBS论坛系统的开发毕业论文
- bbs论坛系统毕业设计
- bbs需求分析说明书(完整版).doc
- 基于SSH架构的BBS论坛系统源码
- 基于SSH的BBS论坛系统
- 基于SSM框架的论坛系统
- ssm_bbs项目 基本的增删改查
- 5个BBS 网站 源码
- bbs.tar.gz论坛开发代码
- bbs.rar
- UML案例:BBS系统一
- BBS论坛管理系统”需求分析报告
- 校园BBS管理系统面向对象的分析与设
评论
共有 条评论