- 进销存管理系统 (学生信息管理系统)
底部附上Github地址
- 本篇主要功能:
- 后台管理员登录注册
- 用户注销
- 查看所有员工信息
- 添加员工
- 删除员工
- 修改员工信息
- 基于Struts2 + Hibernate (SH)开发
- Struts.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <package name="default" namespace="/" extends="struts-default"> <!-- 用户登录Action --> <action name="login" class="actions.UserAction" method="login"> <result name="login">/login_success.jsp</result> <result name="error">/login_failure.jsp</result> <result name="input">/login.jsp</result> </action> <!-- 用户注销Action --> <action name="logout" class="actions.UserAction" method="logout"> <result name="logout_success">/login.jsp</result> </action> <!-- 用户注册Action --> <action name="register" class="actions.RegisterAction" method="register"> <result name="success">/sign_success.jsp</result> <result name="input">/sign_error.jsp</result> </action> <!-- 查询所有员工信息Action --> <action name="query" class="actions.EmployeeAction" method="query"> <result name="query_information">/Employees_query_success.jsp</result> </action> <!-- 删除员工信息Action --> <action name="deleteEmployee" class="actions.EmployeeAction" method="deleteEmployee"> <result name="delete_success" type="chain">query</result> </action> <!-- 添加员工资料Action --> <action name="addEmployee" class="actions.EmployeeAction" method="addEmployee"> <result name="success">/Employees_add_success.jsp</result> </action> <!-- 修改员工信息Action --> <action name="modifyEmployee" class="actions.EmployeeAction" method="modifyEmployee"> <result name="modify_success">/Employees_modify.jsp</result> </action> <!-- 保存修改Action --> <action name="saveUpdate" class="actions.EmployeeAction" method="saveUpdate"> <result name="update_success">/Employees_modify_success.jsp</result> </action> </struts>
- Hibernate.cfg.xml
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name="connection.driver_class">com.mysql.jdbc.Driver</property> <property name="connection.url"> jdbc:mysql://localhost:3306/sale?useUnicode=true&characterEncoding=UTF-8 </property> <property name="connection.username">root</property> <property name="connection.password">123456</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="hbm2ddl.auto">update</property> <property name="show_sql">true</property> <mapping resource="entity/User.hbm.xml"/> <mapping resource="entity/Employees.hbm.xml"/> <mapping resource="entity/Commodity.hbm.xml"/> </session-factory> </hibernate-configuration>
Web.xml<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>SH_SaleSystem</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
后台管理员登录页-效果图
后台管理登录成功后-效果图
员工列表-效果图
添加员工-效果图
添加员工成功-效果图
删除员工-效果图
删除员工成功-效果图
修改员工信息-效果图 (点击员工姓名)
修改成功-效果图
(学生信息管理系统)进销存管理系统--员工管理篇
最新推荐文章于 2022-12-26 22:21:35 发布