基于MysqlTomcat的web开发,包含用户注册、登陆,以及后台用户管理等功能
基于Mysql,Tomcat的web开发,包含用户注册、登陆,以及后台用户管理等功能,内含jar包,使用详情点击:https://www.cnblogs.com/zqm-sau/p/9818849.html
代码片段和文件信息
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-10-13 13:48 formal
文件 842 2018-10-13 13:48 formal.classpath
文件 906 2018-10-13 13:48 formal.project
目录 0 2018-10-13 18:08 formal.settings
文件 567 2018-10-13 13:48 formal.settings.jsdtscope
文件 364 2018-10-13 13:48 formal.settingsorg.eclipse.jdt.core.prefs
文件 470 2018-10-13 13:48 formal.settingsorg.eclipse.wst.common.component
文件 345 2018-10-13 13:48 formal.settingsorg.eclipse.wst.common.project.facet.core.xml
文件 49 2018-10-13 13:48 formal.settingsorg.eclipse.wst.jsdt.ui.superType.container
文件 6 2018-10-13 13:48 formal.settingsorg.eclipse.wst.jsdt.ui.superType.name
目录 0 2018-10-19 20:58 formalWebContent
目录 0 2018-10-13 13:48 formalWebContentmeta-INF
文件 39 2018-10-13 13:48 formalWebContentmeta-INFMANIFEST.MF
文件 286 2018-10-19 18:50 formalWebContentManafail.jsp
文件 1578 2018-10-14 18:50 formalWebContentManalogin.jsp
文件 3028 2018-10-19 11:10 formalWebContentManasuccess1.jsp
文件 1229 2018-10-19 10:26 formalWebContentManasuccess2.jsp
目录 0 2018-10-13 13:48 formalWebContentWEB-INF
目录 0 2018-10-18 10:57 formalWebContentWEB-INFlib
文件 20682 2018-10-18 10:57 formalWebContentWEB-INFlibjstl-1.1.2.jar
文件 2036609 2018-10-12 21:35 formalWebContentWEB-INFlibmysql-connector-java-8.0.11.jar
文件 393259 2018-10-18 10:57 formalWebContentWEB-INFlibstandard-1.1.2.jar
文件 652 2018-10-19 09:08 formalWebContentWEB-INFweb.xml
目录 0 2018-10-13 13:55 formalWebContentcss
文件 3606 2018-09-29 10:51 formalWebContentcsslogin.css
文件 3872 2018-09-29 10:25 formalWebContentcss
eg.css
文件 1467 2018-10-19 18:55 formalWebContentdenglu.js
文件 282 2018-10-15 19:01 formalWebContentfail.jsp
文件 1588 2018-10-19 19:41 formalWebContentindex.jsp
文件 2141 2018-10-19 20:32 formalWebContentsuccess1.jsp
文件 1241 2018-10-19 20:34 formalWebContentsuccess2.jsp
............此处省略27个文件信息
package naizi;
import java.io.IOException;
import java.sql.*;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/**
* Servlet implementation class admin2Servlet
*/
@WebServlet(“/admin2Servlet“)
public class admin2Servlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
doPost(request response);
}
protected void doPost(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
String id;
HttpSession session = request.getSession();
ResultSet rs = (ResultSet)session.getAttribute(“rs“);
Connection connection =null;
PreparedStatement ps=null;
String introduce = ““;
String cur = ““;
int i_d;
try {
//获得请求的id,并转换成int类型
id = request.getParameter(“id“);
id = java.net.URLDecoder.decode(id“utf-8“);
i_d = Integer.parseInt(id);
//获得当前页信息,用于返回
cur = request.getParameter(“cur“);
cur = java.net.URLDecoder.decode(cur“utf-8“);
session.setAttribute(“rs“ rs);
connection=JdbcUtils.getCon();
//静态sql语句
String sql = “select * from user1 where id=?“;
ps = (PreparedStatement) connection.prepareStatement(sql);
ps.setInt(1 i_d);
rs = ps.executeQuery();
if(rs.next()){
introduce = rs.getString(“introduce“);
}
//将introduce与cur放入request中
request.setAttribute(“introduce“ introduce);
request.setAttribute(“cur“ cur);
request.getRequestDispatcher(“./Manasuccess2.jsp“).forward(request response);
} catch (Exception e) {
e.printStackTrace();
} finally {
JdbcUtils.close(ps connection);
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-10-13 13:48 formal
文件 842 2018-10-13 13:48 formal.classpath
文件 906 2018-10-13 13:48 formal.project
目录 0 2018-10-13 18:08 formal.settings
文件 567 2018-10-13 13:48 formal.settings.jsdtscope
文件 364 2018-10-13 13:48 formal.settingsorg.eclipse.jdt.core.prefs
文件 470 2018-10-13 13:48 formal.settingsorg.eclipse.wst.common.component
文件 345 2018-10-13 13:48 formal.settingsorg.eclipse.wst.common.project.facet.core.xm
文件 49 2018-10-13 13:48 formal.settingsorg.eclipse.wst.jsdt.ui.superType.container
文件 6 2018-10-13 13:48 formal.settingsorg.eclipse.wst.jsdt.ui.superType.name
目录 0 2018-10-19 20:58 formalWebContent
目录 0 2018-10-13 13:48 formalWebContentme
文件 39 2018-10-13 13:48 formalWebContentme
文件 286 2018-10-19 18:50 formalWebContentManafail.jsp
文件 1578 2018-10-14 18:50 formalWebContentManalogin.jsp
文件 3028 2018-10-19 11:10 formalWebContentManasuccess1.jsp
文件 1229 2018-10-19 10:26 formalWebContentManasuccess2.jsp
目录 0 2018-10-13 13:48 formalWebContentWEB-INF
目录 0 2018-10-18 10:57 formalWebContentWEB-INFlib
文件 20682 2018-10-18 10:57 formalWebContentWEB-INFlibjstl-1.1.2.jar
文件 2036609 2018-10-12 21:35 formalWebContentWEB-INFlibmysql-connector-java-8.0.11.jar
文件 393259 2018-10-18 10:57 formalWebContentWEB-INFlibstandard-1.1.2.jar
文件 652 2018-10-19 09:08 formalWebContentWEB-INFweb.xm
目录 0 2018-10-13 13:55 formalWebContentcss
文件 3606 2018-09-29 10:51 formalWebContentcsslogin.css
文件 3872 2018-09-29 10:25 formalWebContentcss
eg.css
文件 1467 2018-10-19 18:55 formalWebContentdenglu.js
文件 282 2018-10-15 19:01 formalWebContentfail.jsp
文件 1588 2018-10-19 19:41 formalWebContentindex.jsp
文件 2141 2018-10-19 20:32 formalWebContentsuccess1.jsp
文件 1241 2018-10-19 20:34 formalWebContentsuccess2.jsp
............此处省略27个文件信息
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。
评论列表(条)