网上书店(基于JavaWeb和Mysql)项目
网上书店(基于JavaWeb和Mysql)项目,面向客户端的网上书店(即不包含数据管理页面);项目采用经典的MVC模型,由JSP负责前端、JavaBean实现业务逻辑、Servlet执行业务逻辑处理
·
基本介绍:
本项目用jsp框架实现,用mysql做数据库,前端还涉及到js、jQuery、bootstrap等的一些技术,是面向客户端的网上书店(即不包含数据管理模块);项目采用经典的MVC模型,由JSP负责前端、JavaBean实现业务逻辑、Servlet执行业务逻辑处理;其中,Servlet采用Java反射和多Servlet封装技术,使其可以一个Servlet一个主要功能,后续Servlet继承baseServlet即可,通过JSP的标识符反射对应的功能模块,使系统具有更高的内聚性。
功能介绍:
本网上书店主要有登录注册模块、购物车模块、主页显示、订单模块、个人信息模块等,以下为运行截图:
部分代码展示:
baseServlet
public class baseServlet extends HttpServlet {
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String methods = req.getParameter("method");
if(methods == null && methods.equals("")){
methods = "index";
}
Class clz = this.getClass();
try{
Method method = clz.getMethod(methods,HttpServletRequest.class,HttpServletResponse.class);
Object result = method.invoke(this,req,resp);
if (result != null) {
String str = (String) result;
if (str.startsWith(psf.FORWARD)) {
String path = str.substring(str.indexOf(psf.FLAG) + 1);
req.getRequestDispatcher(path).forward(req, resp);
} else if (str.startsWith(psf.SENDIRECT)) {
String path = str.substring(str.indexOf(psf.FLAG) + 1);
resp.sendRedirect(path);
} else resp.getWriter().print(str);
}
}catch (Exception e){
e.printStackTrace();
}
}
附加内容:
本项目有eclipse版本和idea版本,内包含源代码、数据库及基本测试数据、项目附带测试图片、帮助文档(帮助文档仅限于答辩时的一些技术解答,不包括引入项目并使用,需要下载项目和jar包。
所需jar包:
https://download.csdn.net/download/Wong_H/87262944https://download.csdn.net/download/Wong_H/87262944
eclipse版:
https://download.csdn.net/download/Wong_H/85826192https://download.csdn.net/download/Wong_H/85826192
idea版:
https://download.csdn.net/download/Wong_H/85826653https://download.csdn.net/download/Wong_H/85826653
更多推荐
已为社区贡献1条内容
所有评论(0)