兄弟们,我又回来啦!

上次我把表建完了。今天来点干货,我们用ssm框架来先简单实现一下管理员的登录功能。

在实现之前,我对user表(管理员表)做了些简单的修改,先来看看:

忽略哪些蓝色的马赛克和乱输的数据,这个表一共5个字段,useraccountnum为账号,其他的都应该能看出来是什么。当然这里还是要说一句,这不是最终的表结构,以后根据需求还会修改的。

那么表有了,开始创建一个动态网页项目,这里我用的eclipse,项目是导的包,包如下:

本来想用maven配置包的,但想到自己对maven用的不熟练,算了,下次用maven做。

建好目录,项目结构如下:

项目名是pls,取得是parts,Library,System三个单词的首字母。服务器用的tomcat9,我觉得挺好用的。比myeclipse自带的服务器不知道快到哪里去了。

首先来看web.xml,代码如下:

1 <?xml version="1.0" encoding="UTF-8"?>
2 <web-appxmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://xmlns.jcp.org/xml/ns/javaee"xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"id="WebApp_ID"version="3.1">
3   <display-name>pls</display-name>
4   <welcome-file-list>
5     <welcome-file>login.html</welcome-file>
6     <welcome-file>index.htm</welcome-file>
7     <welcome-file>index.jsp</welcome-file>
8     <welcome-file>default.html</welcome-file>
9     <welcome-file>default.htm</welcome-file>
10     <welcome-file>default.jsp</welcome-file>
11   </welcome-file-list>
12
13   <!--加载spring容器-->
14     <context-param>
15         <param-name>contextConfigLocation</param-name>
16         <param-value>/WEB-INF/classes/spring/applicationContext.xml,/WEB-INF/classes/spring/applicationContext-*.xml</param-value>
17     </context-param>
18     <listener>
19         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
20     </listener>
21
22
23     <!--编码过滤器-->
24     <filter>
25         <filter-name>encodingFilter</filter-name>
26         <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
27         <async-supported>true</async-supported>
28         <init-param>
29             <param-name>encoding</param-name>
30             <param-value>UTF-8</param-value>
31         </init-param>
32     </filter>
33     <filter-mapping>
34         <filter-name>encodingFilter</filter-name>
35         <url-pattern>/*</url-pattern>
36     </filter-mapping>
37
38     <!--Spring监听器-->
39     <listener>
40         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
41     </listener>
42
43     <!--Spring MVC servlet-->
44     <servlet>
45         <servlet-name>SpringMVC</servlet-name>
46         <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
47         <init-param>
48             <param-name>contextConfigLocation</param-name>
49             <param-value>/WEB-INF/classes/spring/springmvc.xml</param-value>
50         </init-param>
51         <!--
52 <load-on-startup>1</load-on-startup>53 <async-supported>true</async-supported>54         -->
55     </servlet>
56     <servlet-mapping>
57         <servlet-name>SpringMVC</servlet-name>
58         <url-pattern>*.action</url-pattern>
59     </servlet-mapping>
60     <welcome-file-list>
61         <welcome-file>/index.jsp</welcome-file>
62     </welcome-file-list>
63
64 </web-app>

感觉没什么好说的,用处注释都写了,看下一项,config文件夹的目录结构:

一样一样来,先是applicationContext.xml:

1 <beansxmlns="http://www.springframework.org/schema/beans"
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:mvc="http://www.springframework.org/schema/mvc"
3 xmlns:context="http://www.springframework.org/schema/context"
4 xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"
5 xsi:schemaLocation="http://www.springframework.org/schema/beans6 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd7 http://www.springframework.org/schema/mvc8 http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd9 http://www.springframework.org/schema/context10 http://www.springframework.org/schema/context/spring-context-3.1.xsd11 http://www.springframework.org/schema/aop12 http://www.springframework.org/schema/aop/spring-aop-3.1.xsd13 http://www.springframework.org/schema/tx14 http://www.springframework.org/schema/tx/spring-tx-3.1.xsd ">
15
16
17     <!--加载配置文件-->
18     <context:property-placeholderlocation="classpath:db.properties" />
19     <!--使用第三方的数据库连接池dbcp-->
20     <beanid="dataSource"class="org.apache.commons.dbcp.BasicDataSource"
21 destroy-method="close">
22         <propertyname="driverClassName"value="${jdbc.driver}" />
23         <propertyname="url"value="${jdbc.url}" />
24         <propertyname="username"value="${jdbc.username}" />
25         <propertyname="password"value="${jdbc.password}" />
26         <!--开发阶段数据库最大连接数建议设置小一点够用即可,设置为3-->
27         <propertyname="maxActive"value="${jdbc.maxActive}" />
28         <propertyname="maxIdle"value="${jdbc.maxIdle}" />
29     </bean>
30
31     <!--事务管理-->
32
33     <!--事务管理器34 mybatis使用jdbc事务管理35      -->
36     <beanid="transactionManager"class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
37         <!--数据源-->
38         <propertyname="dataSource"ref="dataSource"/>
39     </bean>
40
41     <!--通知-->
42     <tx:adviceid="txAdvice"transaction-manager="transactionManager">
43         <!--配置传播行为-->
44         <tx:attributes>
45             <tx:methodname="save*"propagation="REQUIRED" />
46             <tx:methodname="insert*"propagation="REQUIRED"/>
47             <tx:methodname="update*"propagation="REQUIRED"/>
48             <tx:methodname="delete*"propagation="REQUIRED"/>
49             <tx:methodname="find*"propagation="SUPPORTS"read-only="true"/>
50             <tx:methodname="get*"propagation="SUPPORTS"read-only="true"/>
51             <tx:methodname="select*"propagation="SUPPORTS"read-only="true"/>
52         </tx:attributes>
53     </tx:advice>
54
55     <!--aop配置-->
56     <aop:config>
57         <aop:advisoradvice-ref="txAdvice"
58 pointcut="execution(* com.pls.service.imp.*.*(..))"/>
59     </aop:config>
60
61
62 </beans>

然后是applicationContext-dao.xml:

1 <beansxmlns="http://www.springframework.org/schema/beans"
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:mvc="http://www.springframework.org/schema/mvc"
3 xmlns:context="http://www.springframework.org/schema/context"
4 xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"
5 xsi:schemaLocation="http://www.springframework.org/schema/beans6 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd7 http://www.springframework.org/schema/mvc8 http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd9 http://www.springframework.org/schema/context10 http://www.springframework.org/schema/context/spring-context-3.1.xsd11 http://www.springframework.org/schema/aop12 http://www.springframework.org/schema/aop/spring-aop-3.1.xsd13 http://www.springframework.org/schema/tx14 http://www.springframework.org/schema/tx/spring-tx-3.1.xsd ">
15
16 <!--配置SqlSessionFactory-->
17 <beanid="sqlSessionFactoryBean"class="org.mybatis.spring.SqlSessionFactoryBean">
18     <!--数据源-->
19     <propertyname="dataSource"ref="dataSource"/>
20     <!--配置SqlMapConfig.xml-->
21     <propertyname="configLocation"value="classpath:mybatis/SqlMapConfig.xml"/>
22 </bean>
23
24 <!--配置userDao-->
25 <!--<bean id="userDao" class="cn.itcast.ssm.dao.old.UserDaoImpl">26 注入会话工厂27 <property name="sqlSessionFactory" ref="sqlSessionFactoryBean"/>28 </bean>-->
29
30
31 <!--mapper动态代理-->
32 <!--配置userMapper33 MapperFactoryBean:用于生成 代理对象34  -->
35 <!--<bean id="userMapper" class="org.mybatis.spring.mapper.MapperFactoryBean">36 注入会话工厂37 <property name="sqlSessionFactory" ref="sqlSessionFactoryBean"/>38 mapper接口39 <property name="mapperInterface" value="cn.itcast.ssm.dao.mapper.UserMapper"/>40 </bean>-->
41
42 <!--使用mapper批量扫描器扫描mapper接口43 规则:mapper.xml和mapper.java在一个目录 且同名即可44 扫描出来mapper,自动让spring容器注册,bean的id就是mapper类名(首字母小写)45  -->
46 <beanclass="org.mybatis.spring.mapper.MapperScannerConfigurer">
47     <!--会话工厂-->
48     <propertyname="sqlSessionFactoryBeanName"value="sqlSessionFactoryBean"/>
49   <!--扫描包路径50 多个包中间用半角逗号分隔51    -->
52     <propertyname="basePackage"value="com.pls.mapper"/>
53 </bean>
54
55
56 </beans>

这是以前学的时候用的配置文件,改了改继续拿来用,所以有大量注释掉的代码(我舍不得删.)

applicationContext-service.xml:

1 <beansxmlns="http://www.springframework.org/schema/beans"
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:mvc="http://www.springframework.org/schema/mvc"
3 xmlns:context="http://www.springframework.org/schema/context"
4 xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"
5 xsi:schemaLocation="http://www.springframework.org/schema/beans6 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd7 http://www.springframework.org/schema/mvc8 http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd9 http://www.springframework.org/schema/context10 http://www.springframework.org/schema/context/spring-context-3.1.xsd11 http://www.springframework.org/schema/aop12 http://www.springframework.org/schema/aop/spring-aop-3.1.xsd13 http://www.springframework.org/schema/tx14 http://www.springframework.org/schema/tx/spring-tx-3.1.xsd ">
15
16
17 <!--用户管理-->
18
19 <beanid="plsService"class="com.pls.service.imp.PlsServiceImp"/>
20
21 </beans>

这里我本来想用注解代替的,但不知怎么的注解没起作用,无法完成注入,有大神的话希望看到后面能为我指出原因。

springmvc-xml:

1 <beansxmlns="http://www.springframework.org/schema/beans"
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:mvc="http://www.springframework.org/schema/mvc"
3 xmlns:context="http://www.springframework.org/schema/context"
4 xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"
5 xsi:schemaLocation="http://www.springframework.org/schema/beans6 http://www.springframework.org/schema/beans/spring-beans-3.1.xsd7 http://www.springframework.org/schema/mvc8 http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd9 http://www.springframework.org/schema/context10 http://www.springframework.org/schema/context/spring-context-3.1.xsd11 http://www.springframework.org/schema/aop12 http://www.springframework.org/schema/aop/spring-aop-3.1.xsd13 http://www.springframework.org/schema/tx14 http://www.springframework.org/schema/tx/spring-tx-3.1.xsd ">
15
16     <!--组件扫描 只扫描action-->
17     <context:component-scanbase-package="com.pls.controller" />
18
19
20     <!--使用<mvc:annotation-driven />替换上边定义的处理器映射器和适配器-->
21     <mvc:annotation-driven/>
22
23     <!--视图解析器 解析jsp视图,默认使用jstl,要求classpath下有jstl的jar包-->
24     <bean25         class="org.springframework.web.servlet.view.InternalResourceViewResolver">
26         <!--视图的前缀-->
27         <propertyname="prefix"value="/WEB-INF/jsp/" />
28         <!--视图的后缀-->
29         <propertyname="suffix"value=".jsp" />
30
31
32     </bean>
33
34
35     <!--拦截器-->
36     <mvc:interceptors>
37
38         <mvc:interceptor>
39             <mvc:mappingpath="/**" />
40             <beanclass="interceptor.LoginInterceptor"></bean>
41         </mvc:interceptor>
42
43     </mvc:interceptors>
44
45
46 </beans>

还有:sqlmapconfig.xml:

1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE configuration3 PUBLIC "-//mybatis.org//DTD Config 3.0//EN"4 "http://mybatis.org/dtd/mybatis-3-config.dtd">
5 <configuration>
6
7     <!--定义别名-->
8     <typeAliases>
9         <packagename="com.pls.po" />
10     </typeAliases>
11     <!--配置mapper映射文件-->
12     <mappers>
13         <!--加载 原始dao使用映射文件-->
14         <!--<mapper resource="sqlmap/User.xml" />-->
15
16         <!--批量mapper扫描 遵循规则:将mapper.xml和mapper.java文件放在一个目录 且文件名相同-->
17         <!--<package name="cn.itcast.ssm.dao.mapper" />-->
18     </mappers>
19 </configuration>

为什么<mappers>内没有代码?回去看dao的xml。

接下来是mapper的目录和po的目录:

这里共有八张表的接口和pojo,今天要涉及到的只有红圈的选中的部分。

这些mapper和pojo不全是自己写的,大部分还是利用mybatis的逆向工程生成的,生成的配置文件如下:

1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE generatorConfiguration3 PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"4 "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
5
6 <generatorConfiguration>
7     <contextid="testTables"targetRuntime="MyBatis3">
8         <commentGenerator>
9             <!--是否去除自动生成的注释 true:是 : false:否-->
10             <propertyname="suppressAllComments"value="true" />
11         </commentGenerator>
12         <!--数据库连接的信息:驱动类、连接地址、用户名、密码-->
13         <jdbcConnectiondriverClass="com.mysql.jdbc.Driver"
14 connectionURL="jdbc:mysql://localhost:3306/partslibrarysystem"userId="root"
15 password="202011">
16         </jdbcConnection>
17         <!--<jdbcConnection driverClass="oracle.jdbc.OracleDriver"18 connectionURL="jdbc:oracle:thin:@127.0.0.1:1521:yycg"19 userId="yycg"20 password="yycg">21 </jdbcConnection>-->
22
23         <!--默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer,为 true时把JDBC DECIMAL 和24 NUMERIC 类型解析为java.math.BigDecimal-->
25         <javaTypeResolver>
26             <propertyname="forceBigDecimals"value="false" />
27         </javaTypeResolver>
28
29         <!--targetProject:生成PO类的位置-->
30
31         <javaModelGeneratortargetPackage="com.pls.po"
32 targetProject=".\src">
33
34             <!--enableSubPackages:是否让schema作为包的后缀-->
35
36             <propertyname="enableSubPackages"value="false" />
37
38             <!--从数据库返回的值被清理前后的空格-->
39
40             <propertyname="trimStrings"value="true" />
41         </javaModelGenerator>
42
43         <!--targetProject:mapper映射文件生成的位置-->
44         <sqlMapGeneratortargetPackage="com.pls.mapper"
45 targetProject=".\src">
46             <!--enableSubPackages:是否让schema作为包的后缀-->
47             <propertyname="enableSubPackages"value="false" />
48         </sqlMapGenerator>
49         <!--targetPackage:mapper接口生成的位置-->
50         <javaClientGeneratortype="XMLMAPPER"
51 targetPackage="com.pls.mapper"
52 targetProject=".\src">
53             <!--enableSubPackages:是否让schema作为包的后缀-->
54             <propertyname="enableSubPackages"value="false" />
55         </javaClientGenerator>
56         <!--指定数据库表-->
57         <tableschema=""tableName="allsortparts"></table>
58         <tableschema=""tableName="user"></table>
59         <tableschema=""tableName="bearing"></table>
60         <tableschema=""tableName="coupling"></table>
61         <tableschema=""tableName="electromotor"></table>
62         <tableschema=""tableName="fastener"></table>
63         <tableschema=""tableName="flange"></table>
64         <tableschema=""tableName="sealing_element"></table>
65
66         <!--有些表的字段需要指定java类型67 <table schema="" tableName="">68 <columnOverride column="" javaType="" />69 </table>-->
70     </context>
71 </generatorConfiguration>

还需要这个java类:

1 packagegm;2
3
4 importjava.io.File;5 importjava.util.ArrayList;6 importjava.util.List;7
8 importorg.mybatis.generator.api.MyBatisGenerator;9 importorg.mybatis.generator.config.Configuration;10 importorg.mybatis.generator.config.xml.ConfigurationParser;11 importorg.mybatis.generator.internal.DefaultShellCallback;12
13 public classGeneratorSqlmap {14
15     public void generator() throwsException{16
17         List<String> warnings = new ArrayList<String>();18         boolean overwrite = true;19         //指定逆向工程配置文件。
20         File configFile = new File("generatorConfig.xml");21         ConfigurationParser cp = newConfigurationParser(warnings);22         Configuration config =cp.parseConfiguration(configFile);23         DefaultShellCallback callback = newDefaultShellCallback(overwrite);24         MyBatisGenerator myBatisGenerator = newMyBatisGenerator(config,25 callback, warnings);26         myBatisGenerator.generate(null);27
28 }29     public static void main(String[] args) throwsException {30         try{31             GeneratorSqlmap generatorSqlmap = newGeneratorSqlmap();32 generatorSqlmap.generator();33         } catch(Exception e) {34 e.printStackTrace();35 }36
37 }38
39 }

运行这个文件,mapper和pojo就自动帮你生成了,是不是很方便。

看一看mapper.xml和dao接口吧:

1 packagecom.pls.mapper;2
3 importcom.pls.po.User;4 importcom.pls.po.UserExample;5 importjava.util.List;6 importorg.apache.ibatis.annotations.Param;7
8 public interfaceUserMapper {9     intcountByExample(UserExample example);10
11     intdeleteByExample(UserExample example);12
13     intdeleteByPrimaryKey(Integer iduser);14
15     intinsert(User record);16
17     intinsertSelective(User record);18
19     List<User>selectByExample(UserExample example);20
21 User selectByPrimaryKey(Integer iduser);22
23     int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);24
25     int updateByExample(@Param("record") User record, @Param("example") UserExample example);26
27     intupdateByPrimaryKeySelective(User record);28
29     intupdateByPrimaryKey(User record);30
31 User selectByUseraccountnum(String useraccountnum);32
33     List<User>getAllUser();34
35 }

1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
3 <mapper namespace="com.pls.mapper.UserMapper" >
4   <resultMap id="BaseResultMap" type="com.pls.po.User" >
5     <id column="iduser" property="iduser" jdbcType="INTEGER" />
6     <result column="username" property="username" jdbcType="VARCHAR" />
7     <result column="userpassword" property="userpassword" jdbcType="VARCHAR" />
8     <result column="useraccountnum" property="useraccountnum" jdbcType="VARCHAR" />
9     <result column="useremail" property="useremail" jdbcType="VARCHAR" />
10   </resultMap>
11   <sql id="Example_Where_Clause" >
12     <where >
13       <foreach collection="oredCriteria" item="criteria" separator="or" >
14         <if test="criteria.valid" >
15           <trim prefix="(" suffix=")" prefixOverrides="and" >
16             <foreach collection="criteria.criteria" item="criterion" >
17               <choose >
18                 <when test="criterion.noValue" >
19 and ${criterion.condition}20                 </when>
21                 <when test="criterion.singleValue" >
22 and ${criterion.condition} #{criterion.value}23                 </when>
24                 <when test="criterion.betweenValue" >
25 and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}26                 </when>
27                 <when test="criterion.listValue" >
28 and ${criterion.condition}29                   <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
30 #{listItem}31                   </foreach>
32                 </when>
33               </choose>
34             </foreach>
35           </trim>
36         </if>
37       </foreach>
38     </where>
39   </sql>
40   <sql id="Update_By_Example_Where_Clause" >
41     <where >
42       <foreach collection="example.oredCriteria" item="criteria" separator="or" >
43         <if test="criteria.valid" >
44           <trim prefix="(" suffix=")" prefixOverrides="and" >
45             <foreach collection="criteria.criteria" item="criterion" >
46               <choose >
47                 <when test="criterion.noValue" >
48 and ${criterion.condition}49                 </when>
50                 <when test="criterion.singleValue" >
51 and ${criterion.condition} #{criterion.value}52                 </when>
53                 <when test="criterion.betweenValue" >
54 and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}55                 </when>
56                 <when test="criterion.listValue" >
57 and ${criterion.condition}58                   <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
59 #{listItem}60                   </foreach>
61                 </when>
62               </choose>
63             </foreach>
64           </trim>
65         </if>
66       </foreach>
67     </where>
68   </sql>
69   <sql id="Base_Column_List" >
70 iduser, username, userpassword, useraccountnum, useremail71   </sql>
72   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.pls.po.UserExample" >
73 select74     <if test="distinct" >
75 distinct76     </if>
77     <include refid="Base_Column_List" />
78 from user79     <if test="_parameter != null" >
80       <include refid="Example_Where_Clause" />
81     </if>
82     <if test="orderByClause != null" >
83 order by ${orderByClause}84     </if>
85   </select>
86   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
87 select88     <include refid="Base_Column_List" />
89 from user90     where iduser = #{iduser,jdbcType=INTEGER}91   </select>
92   <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
93 delete from user94     where iduser = #{iduser,jdbcType=INTEGER}95   </delete>
96   <delete id="deleteByExample" parameterType="com.pls.po.UserExample" >
97 delete from user98     <if test="_parameter != null" >
99       <include refid="Example_Where_Clause" />
100     </if>
101   </delete>
102   <insert id="insert" parameterType="com.pls.po.User" >
103 insert into user (iduser, username, userpassword,104 useraccountnum, useremail)105     values (#{iduser,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{userpassword,jdbcType=VARCHAR},106       #{useraccountnum,jdbcType=VARCHAR}, #{useremail,jdbcType=VARCHAR})107   </insert>
108   <insert id="insertSelective" parameterType="com.pls.po.User" >
109 insert into user110     <trim prefix="(" suffix=")" suffixOverrides="," >
111       <if test="iduser != null" >
112 iduser,113       </if>
114       <if test="username != null" >
115 username,116       </if>
117       <if test="userpassword != null" >
118 userpassword,119       </if>
120       <if test="useraccountnum != null" >
121 useraccountnum,122       </if>
123       <if test="useremail != null" >
124 useremail,125       </if>
126     </trim>
127     <trim prefix="values (" suffix=")" suffixOverrides="," >
128       <if test="iduser != null" >
129         #{iduser,jdbcType=INTEGER},130       </if>
131       <if test="username != null" >
132         #{username,jdbcType=VARCHAR},133       </if>
134       <if test="userpassword != null" >
135         #{userpassword,jdbcType=VARCHAR},136       </if>
137       <if test="useraccountnum != null" >
138         #{useraccountnum,jdbcType=VARCHAR},139       </if>
140       <if test="useremail != null" >
141         #{useremail,jdbcType=VARCHAR},142       </if>
143     </trim>
144   </insert>
145   <select id="countByExample" parameterType="com.pls.po.UserExample" resultType="java.lang.Integer" >
146     select count(*) from user147     <if test="_parameter != null" >
148       <include refid="Example_Where_Clause" />
149     </if>
150   </select>
151   <update id="updateByExampleSelective" parameterType="map" >
152 update user153     <set >
154       <if test="record.iduser != null" >
155         iduser = #{record.iduser,jdbcType=INTEGER},156       </if>
157       <if test="record.username != null" >
158         username = #{record.username,jdbcType=VARCHAR},159       </if>
160       <if test="record.userpassword != null" >
161         userpassword = #{record.userpassword,jdbcType=VARCHAR},162       </if>
163       <if test="record.useraccountnum != null" >
164         useraccountnum = #{record.useraccountnum,jdbcType=VARCHAR},165       </if>
166       <if test="record.useremail != null" >
167         useremail = #{record.useremail,jdbcType=VARCHAR},168       </if>
169     </set>
170     <if test="_parameter != null" >
171       <include refid="Update_By_Example_Where_Clause" />
172     </if>
173   </update>
174   <update id="updateByExample" parameterType="map" >
175 update user176     set iduser = #{record.iduser,jdbcType=INTEGER},177       username = #{record.username,jdbcType=VARCHAR},178       userpassword = #{record.userpassword,jdbcType=VARCHAR},179       useraccountnum = #{record.useraccountnum,jdbcType=VARCHAR},180       useremail = #{record.useremail,jdbcType=VARCHAR}181     <if test="_parameter != null" >
182       <include refid="Update_By_Example_Where_Clause" />
183     </if>
184   </update>
185   <update id="updateByPrimaryKeySelective" parameterType="com.pls.po.User" >
186 update user187     <set >
188       <if test="username != null" >
189         username = #{username,jdbcType=VARCHAR},190       </if>
191       <if test="userpassword != null" >
192         userpassword = #{userpassword,jdbcType=VARCHAR},193       </if>
194       <if test="useraccountnum != null" >
195         useraccountnum = #{useraccountnum,jdbcType=VARCHAR},196       </if>
197       <if test="useremail != null" >
198         useremail = #{useremail,jdbcType=VARCHAR},199       </if>
200     </set>
201     where iduser = #{iduser,jdbcType=INTEGER}202   </update>
203   <update id="updateByPrimaryKey" parameterType="com.pls.po.User" >
204 update user205     set username = #{username,jdbcType=VARCHAR},206       userpassword = #{userpassword,jdbcType=VARCHAR},207       useraccountnum = #{useraccountnum,jdbcType=VARCHAR},208       useremail = #{useremail,jdbcType=VARCHAR}209     where iduser = #{iduser,jdbcType=INTEGER}210   </update>
211
212   <!-- 上面是机器生成的代码,以下是自己写的 -->
213   <select id="selectByUseraccountnum" resultMap="BaseResultMap" parameterType="java.lang.String" >
214 select215     <include refid="Base_Column_List" />
216 from user217     where useraccountnum = #{useraccountnum,jdbcType=VARCHAR}218   </select>
219
220   <select id="getAllUser" resultMap="BaseResultMap" >
221     select *from user222   </select>
223
224
225 </mapper>

user.java没什么好说的,但还是贴上来:

1 packagecom.pls.po;2
3 public classUser {4     privateInteger iduser;5
6     privateString username;7
8     privateString userpassword;9
10     privateString useraccountnum;11
12     privateString useremail;13
14     publicInteger getIduser() {15         returniduser;16 }17
18     public voidsetIduser(Integer iduser) {19         this.iduser =iduser;20 }21
22     publicString getUsername() {23         returnusername;24 }25
26     public voidsetUsername(String username) {27         this.username = username == null ? null: username.trim();28 }29
30     publicString getUserpassword() {31         returnuserpassword;32 }33
34     public voidsetUserpassword(String userpassword) {35         this.userpassword = userpassword == null ? null: userpassword.trim();36 }37
38     publicString getUseraccountnum() {39         returnuseraccountnum;40 }41
42     public voidsetUseraccountnum(String useraccountnum) {43         this.useraccountnum = useraccountnum == null ? null: useraccountnum.trim();44 }45
46     publicString getUseremail() {47         returnuseremail;48 }49
50     public voidsetUseremail(String useremail) {51         this.useremail = useremail == null ? null: useremail.trim();52 }53
54 @Override55     publicString toString() {56         return "User [iduser=" + iduser + ", username=" + username + ", userpassword=" +userpassword57                 + ", useraccountnum=" + useraccountnum + ", useremail=" + useremail + "]";58 }59
60
61
62 }

userExample看了下,有点晕:

1 packagecom.pls.po;2
3 importjava.util.ArrayList;4 importjava.util.List;5
6 public classUserExample {7     protectedString orderByClause;8
9     protected booleandistinct;10
11     protected List<Criteria>oredCriteria;12
13     publicUserExample() {14         oredCriteria = new ArrayList<Criteria>();15 }16
17     public voidsetOrderByClause(String orderByClause) {18         this.orderByClause =orderByClause;19 }20
21     publicString getOrderByClause() {22         returnorderByClause;23 }24
25     public void setDistinct(booleandistinct) {26         this.distinct =distinct;27 }28
29     public booleanisDistinct() {30         returndistinct;31 }32
33     public List<Criteria>getOredCriteria() {34         returnoredCriteria;35 }36
37     public voidor(Criteria criteria) {38 oredCriteria.add(criteria);39 }40
41     publicCriteria or() {42         Criteria criteria =createCriteriaInternal();43 oredCriteria.add(criteria);44         returncriteria;45 }46
47     publicCriteria createCriteria() {48         Criteria criteria =createCriteriaInternal();49         if (oredCriteria.size() == 0) {50 oredCriteria.add(criteria);51 }52         returncriteria;53 }54
55     protectedCriteria createCriteriaInternal() {56         Criteria criteria = newCriteria();57         returncriteria;58 }59
60     public voidclear() {61 oredCriteria.clear();62         orderByClause = null;63         distinct = false;64 }65
66     protected abstract static classGeneratedCriteria {67         protected List<Criterion>criteria;68
69         protectedGeneratedCriteria() {70             super();71             criteria = new ArrayList<Criterion>();72 }73
74         public booleanisValid() {75             return criteria.size() > 0;76 }77
78         public List<Criterion>getAllCriteria() {79             returncriteria;80 }81
82         public List<Criterion>getCriteria() {83             returncriteria;84 }85
86         protected voidaddCriterion(String condition) {87             if (condition == null) {88                 throw new RuntimeException("Value for condition cannot be null");89 }90             criteria.add(newCriterion(condition));91 }92
93         protected voidaddCriterion(String condition, Object value, String property) {94             if (value == null) {95                 throw new RuntimeException("Value for " + property + " cannot be null");96 }97             criteria.add(newCriterion(condition, value));98 }99
100         protected voidaddCriterion(String condition, Object value1, Object value2, String property) {101             if (value1 == null || value2 == null) {102                 throw new RuntimeException("Between values for " + property + " cannot be null");103 }104             criteria.add(newCriterion(condition, value1, value2));105 }106
107         publicCriteria andIduserIsNull() {108             addCriterion("iduser is null");109             return (Criteria) this;110 }111
112         publicCriteria andIduserIsNotNull() {113             addCriterion("iduser is not null");114             return (Criteria) this;115 }116
117         publicCriteria andIduserEqualTo(Integer value) {118             addCriterion("iduser =", value, "iduser");119             return (Criteria) this;120 }121
122         publicCriteria andIduserNotEqualTo(Integer value) {123             addCriterion("iduser <>", value, "iduser");124             return (Criteria) this;125 }126
127         publicCriteria andIduserGreaterThan(Integer value) {128             addCriterion("iduser >", value, "iduser");129             return (Criteria) this;130 }131
132         publicCriteria andIduserGreaterThanOrEqualTo(Integer value) {133             addCriterion("iduser >=", value, "iduser");134             return (Criteria) this;135 }136
137         publicCriteria andIduserLessThan(Integer value) {138             addCriterion("iduser <", value, "iduser");139             return (Criteria) this;140 }141
142         publicCriteria andIduserLessThanOrEqualTo(Integer value) {143             addCriterion("iduser <=", value, "iduser");144             return (Criteria) this;145 }146
147         public Criteria andIduserIn(List<Integer>values) {148             addCriterion("iduser in", values, "iduser");149             return (Criteria) this;150 }151
152         public Criteria andIduserNotIn(List<Integer>values) {153             addCriterion("iduser not in", values, "iduser");154             return (Criteria) this;155 }156
157         publicCriteria andIduserBetween(Integer value1, Integer value2) {158             addCriterion("iduser between", value1, value2, "iduser");159             return (Criteria) this;160 }161
162         publicCriteria andIduserNotBetween(Integer value1, Integer value2) {163             addCriterion("iduser not between", value1, value2, "iduser");164             return (Criteria) this;165 }166
167         publicCriteria andUsernameIsNull() {168             addCriterion("username is null");169             return (Criteria) this;170 }171
172         publicCriteria andUsernameIsNotNull() {173             addCriterion("username is not null");174             return (Criteria) this;175 }176
177         publicCriteria andUsernameEqualTo(String value) {178             addCriterion("username =", value, "username");179             return (Criteria) this;180 }181
182         publicCriteria andUsernameNotEqualTo(String value) {183             addCriterion("username <>", value, "username");184             return (Criteria) this;185 }186
187         publicCriteria andUsernameGreaterThan(String value) {188             addCriterion("username >", value, "username");189             return (Criteria) this;190 }191
192         publicCriteria andUsernameGreaterThanOrEqualTo(String value) {193             addCriterion("username >=", value, "username");194             return (Criteria) this;195 }196
197         publicCriteria andUsernameLessThan(String value) {198             addCriterion("username <", value, "username");199             return (Criteria) this;200 }201
202         publicCriteria andUsernameLessThanOrEqualTo(String value) {203             addCriterion("username <=", value, "username");204             return (Criteria) this;205 }206
207         publicCriteria andUsernameLike(String value) {208             addCriterion("username like", value, "username");209             return (Criteria) this;210 }211
212         publicCriteria andUsernameNotLike(String value) {213             addCriterion("username not like", value, "username");214             return (Criteria) this;215 }216
217         public Criteria andUsernameIn(List<String>values) {218             addCriterion("username in", values, "username");219             return (Criteria) this;220 }221
222         public Criteria andUsernameNotIn(List<String>values) {223             addCriterion("username not in", values, "username");224             return (Criteria) this;225 }226
227         publicCriteria andUsernameBetween(String value1, String value2) {228             addCriterion("username between", value1, value2, "username");229             return (Criteria) this;230 }231
232         publicCriteria andUsernameNotBetween(String value1, String value2) {233             addCriterion("username not between", value1, value2, "username");234             return (Criteria) this;235 }236
237         publicCriteria andUserpasswordIsNull() {238             addCriterion("userpassword is null");239             return (Criteria) this;240 }241
242         publicCriteria andUserpasswordIsNotNull() {243             addCriterion("userpassword is not null");244             return (Criteria) this;245 }246
247         publicCriteria andUserpasswordEqualTo(String value) {248             addCriterion("userpassword =", value, "userpassword");249             return (Criteria) this;250 }251
252         publicCriteria andUserpasswordNotEqualTo(String value) {253             addCriterion("userpassword <>", value, "userpassword");254             return (Criteria) this;255 }256
257         publicCriteria andUserpasswordGreaterThan(String value) {258             addCriterion("userpassword >", value, "userpassword");259             return (Criteria) this;260 }261
262         publicCriteria andUserpasswordGreaterThanOrEqualTo(String value) {263             addCriterion("userpassword >=", value, "userpassword");264             return (Criteria) this;265 }266
267         publicCriteria andUserpasswordLessThan(String value) {268             addCriterion("userpassword <", value, "userpassword");269             return (Criteria) this;270 }271
272         publicCriteria andUserpasswordLessThanOrEqualTo(String value) {273             addCriterion("userpassword <=", value, "userpassword");274             return (Criteria) this;275 }276
277         publicCriteria andUserpasswordLike(String value) {278             addCriterion("userpassword like", value, "userpassword");279             return (Criteria) this;280 }281
282         publicCriteria andUserpasswordNotLike(String value) {283             addCriterion("userpassword not like", value, "userpassword");284             return (Criteria) this;285 }286
287         public Criteria andUserpasswordIn(List<String>values) {288             addCriterion("userpassword in", values, "userpassword");289             return (Criteria) this;290 }291
292         public Criteria andUserpasswordNotIn(List<String>values) {293             addCriterion("userpassword not in", values, "userpassword");294             return (Criteria) this;295 }296
297         publicCriteria andUserpasswordBetween(String value1, String value2) {298             addCriterion("userpassword between", value1, value2, "userpassword");299             return (Criteria) this;300 }301
302         publicCriteria andUserpasswordNotBetween(String value1, String value2) {303             addCriterion("userpassword not between", value1, value2, "userpassword");304             return (Criteria) this;305 }306
307         publicCriteria andUseraccountnumIsNull() {308             addCriterion("useraccountnum is null");309             return (Criteria) this;310 }311
312         publicCriteria andUseraccountnumIsNotNull() {313             addCriterion("useraccountnum is not null");314             return (Criteria) this;315 }316
317         publicCriteria andUseraccountnumEqualTo(String value) {318             addCriterion("useraccountnum =", value, "useraccountnum");319             return (Criteria) this;320 }321
322         publicCriteria andUseraccountnumNotEqualTo(String value) {323             addCriterion("useraccountnum <>", value, "useraccountnum");324             return (Criteria) this;325 }326
327         publicCriteria andUseraccountnumGreaterThan(String value) {328             addCriterion("useraccountnum >", value, "useraccountnum");329             return (Criteria) this;330 }331
332         publicCriteria andUseraccountnumGreaterThanOrEqualTo(String value) {333             addCriterion("useraccountnum >=", value, "useraccountnum");334             return (Criteria) this;335 }336
337         publicCriteria andUseraccountnumLessThan(String value) {338             addCriterion("useraccountnum <", value, "useraccountnum");339             return (Criteria) this;340 }341
342         publicCriteria andUseraccountnumLessThanOrEqualTo(String value) {343             addCriterion("useraccountnum <=", value, "useraccountnum");344             return (Criteria) this;345 }346
347         publicCriteria andUseraccountnumLike(String value) {348             addCriterion("useraccountnum like", value, "useraccountnum");349             return (Criteria) this;350 }351
352         publicCriteria andUseraccountnumNotLike(String value) {353             addCriterion("useraccountnum not like", value, "useraccountnum");354             return (Criteria) this;355 }356
357         public Criteria andUseraccountnumIn(List<String>values) {358             addCriterion("useraccountnum in", values, "useraccountnum");359             return (Criteria) this;360 }361
362         public Criteria andUseraccountnumNotIn(List<String>values) {363             addCriterion("useraccountnum not in", values, "useraccountnum");364             return (Criteria) this;365 }366
367         publicCriteria andUseraccountnumBetween(String value1, String value2) {368             addCriterion("useraccountnum between", value1, value2, "useraccountnum");369             return (Criteria) this;370 }371
372         publicCriteria andUseraccountnumNotBetween(String value1, String value2) {373             addCriterion("useraccountnum not between", value1, value2, "useraccountnum");374             return (Criteria) this;375 }376
377         publicCriteria andUseremailIsNull() {378             addCriterion("useremail is null");379             return (Criteria) this;380 }381
382         publicCriteria andUseremailIsNotNull() {383             addCriterion("useremail is not null");384             return (Criteria) this;385 }386
387         publicCriteria andUseremailEqualTo(String value) {388             addCriterion("useremail =", value, "useremail");389             return (Criteria) this;390 }391
392         publicCriteria andUseremailNotEqualTo(String value) {393             addCriterion("useremail <>", value, "useremail");394             return (Criteria) this;395 }396
397         publicCriteria andUseremailGreaterThan(String value) {398             addCriterion("useremail >", value, "useremail");399             return (Criteria) this;400 }401
402         publicCriteria andUseremailGreaterThanOrEqualTo(String value) {403             addCriterion("useremail >=", value, "useremail");404             return (Criteria) this;405 }406
407         publicCriteria andUseremailLessThan(String value) {408             addCriterion("useremail <", value, "useremail");409             return (Criteria) this;410 }411
412         publicCriteria andUseremailLessThanOrEqualTo(String value) {413             addCriterion("useremail <=", value, "useremail");414             return (Criteria) this;415 }416
417         publicCriteria andUseremailLike(String value) {418             addCriterion("useremail like", value, "useremail");419             return (Criteria) this;420 }421
422         publicCriteria andUseremailNotLike(String value) {423             addCriterion("useremail not like", value, "useremail");424             return (Criteria) this;425 }426
427         public Criteria andUseremailIn(List<String>values) {428             addCriterion("useremail in", values, "useremail");429             return (Criteria) this;430 }431
432         public Criteria andUseremailNotIn(List<String>values) {433             addCriterion("useremail not in", values, "useremail");434             return (Criteria) this;435 }436
437         publicCriteria andUseremailBetween(String value1, String value2) {438             addCriterion("useremail between", value1, value2, "useremail");439             return (Criteria) this;440 }441
442         publicCriteria andUseremailNotBetween(String value1, String value2) {443             addCriterion("useremail not between", value1, value2, "useremail");444             return (Criteria) this;445 }446 }447
448     public static class Criteria extendsGeneratedCriteria {449
450         protectedCriteria() {451             super();452 }453 }454
455     public static classCriterion {456         privateString condition;457
458         privateObject value;459
460         privateObject secondValue;461
462         private booleannoValue;463
464         private booleansingleValue;465
466         private booleanbetweenValue;467
468         private booleanlistValue;469
470         privateString typeHandler;471
472         publicString getCondition() {473             returncondition;474 }475
476         publicObject getValue() {477             returnvalue;478 }479
480         publicObject getSecondValue() {481             returnsecondValue;482 }483
484         public booleanisNoValue() {485             returnnoValue;486 }487
488         public booleanisSingleValue() {489             returnsingleValue;490 }491
492         public booleanisBetweenValue() {493             returnbetweenValue;494 }495
496         public booleanisListValue() {497             returnlistValue;498 }499
500         publicString getTypeHandler() {501             returntypeHandler;502 }503
504         protectedCriterion(String condition) {505             super();506             this.condition =condition;507             this.typeHandler = null;508             this.noValue = true;509 }510
511         protectedCriterion(String condition, Object value, String typeHandler) {512             super();513             this.condition =condition;514             this.value =value;515             this.typeHandler =typeHandler;516             if (value instanceof List<?>) {517                 this.listValue = true;518             } else{519                 this.singleValue = true;520 }521 }522
523         protectedCriterion(String condition, Object value) {524             this(condition, value, null);525 }526
527         protectedCriterion(String condition, Object value, Object secondValue, String typeHandler) {528             super();529             this.condition =condition;530             this.value =value;531             this.secondValue =secondValue;532             this.typeHandler =typeHandler;533             this.betweenValue = true;534 }535
536         protectedCriterion(String condition, Object value, Object secondValue) {537             this(condition, value, secondValue, null);538 }539 }540 }

service接口就不看了,直接看实现类代码:

1 packagecom.pls.service.imp;2
3 importjava.util.List;4
5 importjavax.annotation.Resource;6
7 importorg.springframework.stereotype.Service;8
9 importcom.pls.mapper.UserMapper;10 importcom.pls.po.User;11 importcom.pls.po.UserExample;12 importcom.pls.po.UserExample.Criteria;13 importcom.pls.service.PlsService;14
15 @Service("plsService")16 public class PlsServiceImp implementsPlsService {17
18 @Resource19     privateUserMapper userDao;20
21
22 @Override23     public User getUserById(intiduser) {24         //TODO Auto-generated method stub
25         return this.userDao.selectByPrimaryKey(iduser);26 }27
28 @Override29     public List<User>getAllUser() {30         //TODO Auto-generated method stub31         //List<User> list;32
33
34         //UserExample e=new UserExample();
35
36         List<User> list=this.userDao.getAllUser();37
38         returnlist;39 }40
41     //根据用户名查找用户,主要用于登录时验证密码
42 @Override43     publicUser getUserByUseraccountnum(String useraccountnum){44
45         //UserExample example= new UserExample();46         //Criteria criteria=example.createCriteria();47         //criteria.andUseraccountnumEqualTo(useraccountnum);
48         User user=this.userDao.selectByUseraccountnum(useraccountnum);49
50
51
52         returnuser;53 }54
55     //删除方法
56 @Override57     public void deleteUser(intiduser){58         this.userDao.deleteByPrimaryKey(iduser);59 }60
61     //根据名字或账号查询方法
62 @Override63     public List<User>findByNameOrAccountnum(String nameOrAccountnum){64         UserExample e1=newUserExample();65         Criteria c1=e1.createCriteria();66         c1.andUsernameLike("%"+nameOrAccountnum+"%");67         List<User> list=this.userDao.selectByExample(e1);68         UserExample e2=newUserExample();69         Criteria c2=e2.createCriteria();70         c2.andUseraccountnumLike("%"+nameOrAccountnum+"%");71         list.addAll(this.userDao.selectByExample(e2));72         returnlist;73 }74
75     //插入的方法
76 @Override77     public intinsertUser(User user){78
79         int iduser=this.userDao.insert(user);80
81         returniduser;82 }83
84     //更新用户
85 @Override86     public intupdateUser(User User){87
88         int iduser=this.userDao.updateByPrimaryKey(User);89
90         returniduser;91
92 }93 }

控制层目录:

先看userController:

1 packagecom.pls.controller;2
3 importjavax.servlet.http.HttpServletRequest;4
5 importorg.springframework.context.ApplicationContext;6 importorg.springframework.context.support.ClassPathXmlApplicationContext;7 importorg.springframework.stereotype.Controller;8 importorg.springframework.ui.Model;9 importorg.springframework.web.bind.annotation.RequestMapping;10
11 importcom.pls.po.User;12 importcom.pls.service.PlsService;13
14 @Controller15 @RequestMapping("/log")16 public classUserController {17
18     ApplicationContext ac = new ClassPathXmlApplicationContext(new String[] { "spring/applicationContext.xml",19             "spring/applicationContext-dao.xml", "spring/applicationContext-service.xml"});20     PlsService plsService = (PlsService) ac.getBean("plsService");21
22     //用于验证用户密码是否输入正确
23     @RequestMapping("/submit")24     publicString toIndex(HttpServletRequest request, Model model, String useraccountnum, String password) {25
26
27         User user = this.plsService.getUserByUseraccountnum(useraccountnum);28         if (user != null) {29             if(user.getUserpassword().equals(password)) {30
31                 model.addAttribute("user", user);32                 model.addAttribute("iduser", user.getIduser());33                 return "index";34
35             } else{36                 return "error";37 }38         } else{39             return "error";40 }41
42 }43
44     //跳转到登录页面
45     @RequestMapping("/login")46     public String login(Model model) throwsException {47
48         return "login";49 }50
51
52 }

本来想用注解直接注入service的,结果一直报空指针错误,注入不成功,没办法只好用导配置文件的方式,不知道哪位大神能给我指点一下,说一下那个地方出错了。

这里我就不按action一个一个给你们看jsp页面及实现效果了,现在已经快12点了,我待会儿集中放后面。

manageController:

1 packagecom.pls.controller;2
3 importjava.util.List;4
5 importjavax.servlet.http.HttpServletRequest;6
7 importorg.springframework.context.ApplicationContext;8 importorg.springframework.context.support.ClassPathXmlApplicationContext;9 importorg.springframework.stereotype.Controller;10 importorg.springframework.ui.Model;11 importorg.springframework.web.bind.annotation.PathVariable;12 importorg.springframework.web.bind.annotation.RequestMapping;13 importorg.springframework.web.bind.annotation.RequestMethod;14
15 importcom.pls.po.User;16 importcom.pls.service.PlsService;17
18 @Controller19 @RequestMapping("/manage")20 public classMannageController {21
22     ApplicationContext ac = new ClassPathXmlApplicationContext(new String[] { "spring/applicationContext.xml",23             "spring/applicationContext-dao.xml", "spring/applicationContext-service.xml"});24     PlsService plsService = (PlsService) ac.getBean("plsService");25
26     @RequestMapping("/showUser")27     public String showUser(Model model) throwsException {28
29         List<User> list = this.plsService.getAllUser();30         model.addAttribute("list", list);31
32         return "showUser";33 }34
35     @RequestMapping(value = "/deleteUser/{iduser}", method =RequestMethod.GET)36     public String deleteUser(HttpServletRequest request, Model model, @PathVariable int iduser) throwsException {37
38         this.plsService.deleteUser(iduser);39         List<User> list = this.plsService.getAllUser();40         model.addAttribute("list", list);41
42         return "showUser";43 }44
45     @RequestMapping("/findUser")46     public String findUser(HttpServletRequest request, Model model, String nameOrAccountnum) throwsException {47
48         //this.plsService.findByNameOrAccountnum(nameOrAccountnum);
49         List<User> list = this.plsService.findByNameOrAccountnum(nameOrAccountnum);50         model.addAttribute("list", list);51
52         return "showUser";53 }54
55     //跳转到填加管理员页面
56     @RequestMapping("/addManage")57     public String addManage(Model model) throwsException {58
59         return "addManage";60 }61
62     //添加管理员
63     @RequestMapping("/submitUser")64     publicString submitUser(HttpServletRequest request, Model model, String accountnum, String userpassword,65             String username, String Email) throwsException {66
67         User user = newUser();68 user.setUseraccountnum(accountnum);69 user.setUseremail(Email);70 user.setUsername(username);71 user.setUserpassword(userpassword);72
73         int iduser = this.plsService.insertUser(user);74
75         if (iduser > 0) {76
77             List<User> list = this.plsService.getAllUser();78             model.addAttribute("list", list);79
80             return "showUser";81 }82
83         return "addUserError";84 }85
86     //修改管理员
87     @RequestMapping(value = "/updateUser/{iduser}", method =RequestMethod.GET)88     public String updateUser(HttpServletRequest request, Model model, @PathVariable int iduser) throwsException {89
90         User user = this.plsService.getUserById(iduser);91         model.addAttribute("user", user);92
93         return "updateManage";94 }95
96     //提交修改的管理员
97     @RequestMapping("/updateUserSubmit")98     publicString updateSubmitUser(HttpServletRequest request, Model model, String accountnum, String userpassword,99             String username, String Email, int iduser) throwsException {100
101         User user = newUser();102 user.setUseraccountnum(accountnum);103 user.setUseremail(Email);104 user.setUsername(username);105 user.setUserpassword(userpassword);106 user.setIduser(iduser);107
108         if (this.plsService.updateUser(user) > 0) {109
110             List<User> list = this.plsService.getAllUser();111             model.addAttribute("list", list);112
113             return "showUser";114 }115         return null;116 }117
118 }

webContent目录:

jsp页面代码,依次序排列:

1 <%@ page language="java"contentType="text/html; charset=UTF-8"
2 pageEncoding="UTF-8"%>
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 <html>
5 <head>
6     <title></title>
7     <metacharset="UTF-8">
8     <linkrel="stylesheet"type="text/css"href="<%=request.getContextPath() %>/html/Css/bootstrap.css" />
9     <linkrel="stylesheet"type="text/css"href="<%=request.getContextPath() %>/html/Css/bootstrap-responsive.css" />
10     <linkrel="stylesheet"type="text/css"href="<%=request.getContextPath() %>/html/Css/style.css" />
11     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/jquery2.js"></script>
12     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/jquery2.sorted.js"></script>
13     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/bootstrap.js"></script>
14     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/ckform.js"></script>
15     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/common.js"></script>
16     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/jquerypicture.js"></script>
17
18     <styletype="text/css">
19 body{font-size:20px;
20 padding-bottom:40px;
21 background-color:#e9e7ef;
22         }
23 .sidebar-nav{
24 padding:9px 0;
25         }
26
27 @media (max-width: 980px){
28             /*Enable use of floated navbar text*/
29 .navbar-text.pull-right {30 float:none;
31 padding-left:5px;
32 padding-right:5px;
33             }
34 }35
36
37     </style>
38 </head>
39 <body>
40 <br>
41  <fontcolor="#777777"><strong>请填写管理员资料:</strong></font>
42 <formaction="${pageContext.request.contextPath }/manage/submitUser.action"method="post"class="definewidth m20" >
43 <tableclass="table table-bordered table-hover m10"style="margin-left:10px;margin-top:3px;">
44
45
46    <br>
47     <tr>
48         <tdclass="tableleft">账号</td>
49         <td><inputtype="text"name="accountnum"  /></td>
50         <tdclass="tableleft">密码</td>
51         <td><inputtype="text"name="userpassword"  /></td>
52     </tr>
53     <tr>
54         <tdclass="tableleft">姓名</td>
55         <td><inputtype="text"name="username"   /></td>
56         <tdclass="tableleft">邮箱</td>
57         <td><inputtype="text"name="Email"  /></td>
58     </tr>
59
60
61 </table>
62 <br>
63 &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<buttontype="submit"onclick="${pageContext.request.contextPath }/manage/submitUser.action"class="btn btn-primary">提交</button>
64 </form>
65  <imgsrc=""id="img0" >
66
67 <script>
68 $("#GoodsPicture").change(function(){69     varobjUrl=getObjectURL(this.files[0]) ;70 console.log("objUrl ="+objUrl) ;71     if(objUrl) {72 $("#img0").attr("src", objUrl) ;73 }74 }) ;75
76 </body>
77 </html>
78 <script>
79 $(function(){80 $('#backid').click(function(){81 window.location.href="goodsQuery.html";82 });83 });84
85 </script>

1 <%@ page language="java"contentType="text/html; charset=UTF-8"
2 pageEncoding="UTF-8"%>
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 <htmllang="zh">
5 <head>
6 <metacharset="UTF-8">
7 <metahttp-equiv="X-UA-Compatible"content="IE=edge,chrome=1">
8 <metaname="viewport"content="width=device-width, initial-scale=1.0">
9 <title>插入用户错误错误</title>
10
11
12
13
14
15 </head>
16 <body>
17
18
19 <h1>插入用户错误错误</h1>
20
21
22 </body>
23 </html>

1 <%@ page language="java"contentType="text/html; charset=UTF-8"
2 pageEncoding="UTF-8"%>
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 <htmllang="zh">
5 <head>
6 <metacharset="UTF-8">
7 <metahttp-equiv="X-UA-Compatible"content="IE=edge,chrome=1">
8 <metaname="viewport"content="width=device-width, initial-scale=1.0">
9 <title>错误</title>
10
11
12
13
14
15 </head>
16 <body>
17
18
19 <h1>不存在的用户或用户名密码错误</h1>
20
21
22 </body>
23 </html>

1 <%@ page language="java"contentType="text/html; charset=UTF-8"
2 pageEncoding="UTF-8"%>
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4
5 <html>
6 <head>
7 <metacharset="utf-8">
8 <title>零件库管理系统</title>
9 <metahttp-equiv="Content-Type"content="text/html; charset=utf-8" />
10 <linkhref="../html/Css/adminStyle.css"rel="stylesheet"type="text/css" />
11
12 <title>零件库管理系统</title>
13 <scripttype="text/javascript"src="../html/js/jquery1.js"></script>
14 <scripttype="text/javascript">
15 $(document).ready(16             function() {17 $(".div2").click(18                         function() {19 $(this).next("div").slideToggle("slow").siblings(20                                     ".div3:visible").slideUp("slow");21 });22 });23     functionopenurl(url) {24         varrframe=parent.document.getElementById("rightFrame");25 rframe.src=url;26 }27 </script>
28 <style>
29 body{
30 margin:0;
31 font-family:微软雅黑;
32 background-image:url(images/.jpg);
33 background-repeat:no-repea;
34 background-size:cover;
35 background-attachment:fixed;
36 background-color:#DDDDDD37
38 }
39
40 .top1{
41 position:absolute;
42 top:0px;
43 width:100%;
44 height:20px;
45 text-align:center;
46 color:#FFFFFF;
47 font-size:17px;
48 font-height:20px;
49 font-family:楷体;
50 background-color:#88888851 }
52
53 .title{
54 float:left;
55 margin:-32px 20px;
56 font-size:40px;
57 color:#FFFFFF;
58 font-height:55px;
59 font-family:隶书;
60 }
61
62 .top2{
63 position:absolute;
64 top:20px;
65 width:100%;
66 height:77px;
67 text-align:center;
68 color:#ccffff;
69 background-color:#88888870 }
71
72 .left{
73 position:absolute;
74 left:0px;
75 top:97px;
76 width:200px;
77 height:85%;
78 border-right:1px solid #9370DB;
79 color:#000000;
80 font-size:20px;
81 text-align:center;
82 background-color:#B3B3B383 }
84
85 .right{
86 position:absolute;
87 left:200px;
88 top:97px;
89 width:85.2%;
90 height:85%;
91 border-top:0px solid #484860;
92 font-size:14px;
93 text-align:center;
94 }
95
96 .end{
97 position:absolute;
98 bottom:0px;
99 width:100%;
100 height:30px;
101 text-align:center;
102 color:#556B2F;
103 font-size:17px;
104 font-height:20px;
105 font-family:楷体;
106 background-color:#C0C0C0107 }
108
109 .div1{
110 text-align:center;
111 width:200px;
112 padding-top:10px;
113 }
114
115 .div2{
116 height:40px;
117 line-height:40px;
118 cursor:pointer;
119 font-size:18px;
120 position:relative;
121 border-bottom:#ccc 0px dotted;
122 }
123
124 .spgl{
125 position:absolute;
126 height:20px;
127 width:20px;
128 left:40px;
129 top:10px;
130 background:url(images/1.png);
131 }
132
133 .yhgl{
134 position:absolute;
135 height:20px;
136 width:20px;
137 left:40px;
138 top:10px;
139 background:url(images/4.png);
140 }
141
142 .gggl{
143 position:absolute;
144 height:20px;
145 width:20px;
146 left:40px;
147 top:10px;
148 background:url(images/4.png);
149 }
150
151 .zlgl{
152 position:absolute;
153 height:20px;
154 width:20px;
155 left:40px;
156 top:10px;
157 background:url(images/4.png);
158 }
159
160 .pjgl{
161 position:absolute;
162 height:20px;
163 width:20px;
164 left:40px;
165 top:10px;
166 background:url(images/4.png);
167 }
168
169 .tcht{
170 position:absolute;
171 height:20px;
172 width:20px;
173 left:40px;
174 top:10px;
175 background:url(images/2.png);
176 }
177
178 .div3{
179 display:none;
180 cursor:pointer;
181 font-size:15px;
182 }
183
184 .div3 ul{
185 margin:0;
186 padding:0;
187 }
188
189 .div3 li{
190 height:30px;
191 line-height:30px;
192 list-style:none;
193 border-bottom:#ccc 1px dotted;
194 text-align:center;
195 }
196
197 .a{
198 text-decoration:none;
199 color:#000000;
200 font-size:15px;
201 }
202
203 .a1{
204 text-decoration:none;
205 color:#000000;
206 font-size:18px;
207 }
208 </style>
209 </head>
210 <body>
211
212     <divclass="top1">
213         <marqueescrollAmount=2width=300>数据无价,请谨慎操作!</marquee>
214     </div>
215     <divclass="top2">
216         <divclass="logo">
217             <imgsrc="../html/images/admin_logo.png"title="在哪儿" />
218         </div>
219         <divclass="title" >
220             <h3>零件库管理系统</h3>
221         </div>
222         <divclass="fr top-link">
223             <ahref="admin_list.html"target="mainCont"title="DeathGhost"><i224                 class="adminIcon"></i><span>管理员:${user.username }</span></a>
225         </div>
226     </div>
227
228     <divclass="left">
229         <divclass="div1">
230             <divclass="left_top">
231                 <imgsrc="../html/images/bbb_01.jpg"><imgsrc="../html/images/bbb_02.jpg"
232 id="2"><imgsrc="../html/images/bbb_03.jpg"><img233                     src="../html/images/bbb_04.jpg">
234             </div>
235
236            <divclass="div2">
237                 <divclass="spgl"></div>
238 视频管理239             </div>
240             <divclass="div3">
241                 <li><aclass="a"href="javascript:void(0);"
242 onClick="openurl('videoQuery.html');">查看所有视频</a></li>
243                 <li><aclass="a"href="javascript:void(0);"
244 onClick="openurl('uservideoQuery.html');">用户视频列表</a></li>
245
246             </div>
247             <divclass="div2">
248                 <divclass="spgl"></div>
249 文档管理250             </div>
251             <divclass="div3">
252                 <ul>
253                     <li><aclass="a"href="javascript:void(0);"
254 onClick="openurl('documentQuery.html');">查看所有文档</a></li>
255                         <li><aclass="a"href="javascript:void(0);"
256 onClick="openurl('userdocumentQuery.html');">用户文档列表</a></li>
257
258                 </ul>
259             </div>
260             <divclass="div2">
261                 <divclass="spgl"></div>
262 类别管理263             </div>
264             <divclass="div3">
265                 <ul>
266                     <li><aclass="a"href="javascript:void(0);"
267 onClick="openurl('classQuery.html');">大类信息</a></li>
268
269                 </ul>
270             </div>
271             <divclass="div2">
272                 <divclass="yhgl"></div>
273 用户管理274             </div>
275             <divclass="div3">
276                 <ul>
277                     <li><aclass="a"href="javascript:void(0);"
278 onClick="openurl('studentQuery.html');">学生管理</a></li>
279                     <li><aclass="a"href="javascript:void(0);"
280 onClick="openurl('${pageContext.request.contextPath }/manage/showUser.action');">老师管理</a></li>
281                 </ul>
282             </div>
283
284             <divclass="div2">
285                 <divclass="gggl"></div>
286 评价管理287             </div>
288             <divclass="div3">
289
290                 <ul>
291                     <li><aclass="a"href="javascript:void(0);"
292 onClick="openurl('deletecomment.html');">评价删除</a></li>
293                     <li><aclass="a"href="javascript:void(0);"
294 onClick="openurl('useredit.html');">用户禁言</a></li>
295                 </ul>
296
297             </div>
298             <divclass="div2">
299                 <divclass="pjgl"></div>
300 公告管理301             </div>
302             <divclass="div3">
303                 <ul>
304                     <li><aclass="a"href="javascript:void(0);"
305 onClick="openurl('afficheQuery.html');">查看公告</a></li>
306                     <li><aclass="a"href="javascript:void(0);"
307 onClick="openurl('afficheAdd.html');">添加公告</a></li>
308                 </ul>
309             </div>
310             <aclass="a1"href="login.html"><divclass="div2">
311                     <divclass="tcht"></div>
312 退出后台313                 </div></a>
314         </div>
315     </div>
316
317     <divclass="right">
318         <iframeid="rightFrame"name="rightFrame"width="100%"height="100%"
319 scrolling="auto"marginheight="0"marginwidth="0"align="center"
320 style="border: 0px solid #CCC; margin: 0; padding: 0;"></iframe>
321     </div>
322
323
324
325
326
327
328
329 </body>
330 </html>

1 <%@ page language="java"contentType="text/html; charset=UTF-8"
2 pageEncoding="UTF-8"%>
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 <htmllang="zh">
5 <head>
6 <metacharset="UTF-8">
7 <metahttp-equiv="X-UA-Compatible"content="IE=edge,chrome=1">
8 <metaname="viewport"content="width=device-width, initial-scale=1.0">
9 <title>零件库管理系统登录界面</title>
10
11 <linkrel="stylesheet"type="text/css"href="../html/Css/styles.css">
12
13
14
15 </head>
16 <body>
17
18
19 <divclass="wrapper">
20
21     <divclass="container">
22         <h1>零件库管理系统</h1>
23         <formclass="form"action="${pageContext.request.contextPath }/log/submit.action"method="post">
24             <inputtype="text"placeholder="Username"name="useraccountnum">
25             <inputtype="password"placeholder="Password"name="password"><br>
26             <buttontype="submit"id="login-button"onclick="${pageContext.request.contextPath }/log/submit.action"><strong>登陆</strong></button>
27
28         </form>
29     </div>
30
31     <ulclass="bg-bubbles">
32         <li></li>
33         <li></li>
34
35     </ul>
36
37 </div>
38
39
40
41 </body>
42 </html>

1 <%@ page language="java"contentType="text/html; charset=UTF-8"
2 pageEncoding="UTF-8"%>
3 <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"prefix="fmt"%>
4 <%@ taglib uri="http://java.sun.com/jsp/jstl/core"prefix="c"%>
5 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
6 <html>
7 <head>
8 <title></title>
9 <metacharset="UTF-8">
10 <linkrel="stylesheet"type="text/css"href="<%=request.getContextPath() %>/html/Css/bootstrap.css" />
11 <linkrel="stylesheet"type="text/css"
12 href="<%=request.getContextPath() %>/html/Css/bootstrap-responsive.css" />
13 <linkrel="stylesheet"type="text/css"href="<%=request.getContextPath() %>/html/Css/style.css" />
14 <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/jquery2.js"></script>
15 <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/jquery2.sorted.js"></script>
16 <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/bootstrap.js"></script>
17 <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/ckform.js"></script>
18 <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/common.js"></script>
19
20 <styletype="text/css">
21 body{
22 font-size:20px;
23 padding-bottom:40px;
24 background-color:#e9e7ef;
25 }
26
27 .sidebar-nav{
28 padding:9px 0;
29 }
30
31 @media ( max-width : 980px){
32     /*Enable use of floated navbar text*/
33 .navbar-text.pull-right {34 float:none;
35 padding-left:5px;
36 padding-right:5px;
37     }
38 }39 </style>
40 </head>
41 <body>
42     <formclass="form-inline definewidth m20"action="${pageContext.request.contextPath }/manage/findUser.action"method="post">
43         <fontcolor="#777777"><strong>管理员姓名或账号:</strong></font> <input44             type="text"name="nameOrAccountnum"id="menuname"class="abc input-default"
45 placeholder=""value="">&nbsp;&nbsp;
46         <buttontype="submit"class="btn btn-primary">查询</button>
47         <buttontype="button"id="addnew">
48             <ahref="${pageContext.request.contextPath }/manage/addManage.action">添加管理员</a>
49         </button>
50     </form>
51     <tableclass="table table-bordered table-hover definewidth m10">
52         <thead>
53             <tr>
54                 <th>管理员姓名</th>
55
56                 <th>管理员账号</th>
57
58                 <th>Email</th>
59                 <th>注销账户</th>
60                 <th>修改用户</th>
61             </tr>
62         </thead>
63         <c:forEachitems="${list}"var="manage">
64         <tr>
65             <!--<a href="teacherdetail.html">nblyp</a>-->
66             <td>${manage.username }</td>
67
68             <td>${manage.useraccountnum }</td>
69             <td>${manage.useremail }</td>
70             <!--
71 <td><button type="submit" οnclick="${pageContext.request.contextPath }/manage/deleteUser/${manage.iduser }.action" method="get">注销</button></td>72              -->
73             <td><ahref="${pageContext.request.contextPath }/manage/deleteUser/${manage.iduser }.action">注销</a></td>
74             <td><ahref="${pageContext.request.contextPath }/manage/updateUser/${manage.iduser }.action">修改</a></td>
75         </tr>
76         </c:forEach>
77
78
79     </table>
80
81 </body>
82 </html>

1 <%@ page language="java"contentType="text/html; charset=UTF-8"
2 pageEncoding="UTF-8"%>
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4 <html>
5 <head>
6     <title></title>
7     <metacharset="UTF-8">
8     <linkrel="stylesheet"type="text/css"href="<%=request.getContextPath() %>/html/Css/bootstrap.css" />
9     <linkrel="stylesheet"type="text/css"href="<%=request.getContextPath() %>/html/Css/bootstrap-responsive.css" />
10     <linkrel="stylesheet"type="text/css"href="<%=request.getContextPath() %>/html/Css/style.css" />
11     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/jquery2.js"></script>
12     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/jquery2.sorted.js"></script>
13     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/bootstrap.js"></script>
14     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/ckform.js"></script>
15     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/common.js"></script>
16     <scripttype="text/javascript"src="<%=request.getContextPath() %>/html/js/jquerypicture.js"></script>
17
18     <styletype="text/css">
19 body{font-size:20px;
20 padding-bottom:40px;
21 background-color:#e9e7ef;
22         }
23 .sidebar-nav{
24 padding:9px 0;
25         }
26
27 @media (max-width: 980px){
28             /*Enable use of floated navbar text*/
29 .navbar-text.pull-right {30 float:none;
31 padding-left:5px;
32 padding-right:5px;
33             }
34 }35
36
37     </style>
38 </head>
39 <body>
40 <br>
41  <fontcolor="#777777"><strong>请填写管理员资料:</strong></font>
42 <formaction="${pageContext.request.contextPath }/manage/updateUserSubmit.action"method="post"class="definewidth m20" >
43 <tableclass="table table-bordered table-hover m10"style="margin-left:10px;margin-top:3px;">
44
45
46    <br>
47     <tr>
48
49         <tdclass="tableleft">账号</td>
50         <td><inputtype="text"name="accountnum"value=${user.useraccountnum}/></td>
51         <tdclass="tableleft">密码</td>
52         <td><inputtype="text"name="userpassword"value=${user.userpassword}/></td>
53     </tr>
54     <tr>
55         <tdclass="tableleft">真实姓名</td>
56         <td><inputtype="text"name="username"value=${user.username}/></td>
57         <tdclass="tableleft">邮箱</td>
58         <td><inputtype="text"name="Email"value=${user.useremail}/></td>
59     </tr>
60     <inputtype="hidden"name="iduser"value=${user.iduser}/>
61
62 </table>
63 <br>
64 &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<buttontype="submit"onclick="${pageContext.request.contextPath }/manage/updateUserSubmit.action"class="btn btn-primary">提交</button>
65 </form>
66  <imgsrc=""id="img0" >
67
68 <script>
69 $("#GoodsPicture").change(function(){70     varobjUrl=getObjectURL(this.files[0]) ;71 console.log("objUrl ="+objUrl) ;72     if(objUrl) {73 $("#img0").attr("src", objUrl) ;74 }75 }) ;76
77 </body>
78 </html>
79 <script>
80 $(function(){81 $('#backid').click(function(){82 window.location.href="goodsQuery.html";83 });84 });85
86 </script>

代码是糙了一点,不过因为是第一次做项目嘛,包容包容。

来看看最后效果:

这肯定不是最终版本,我还有一些功能及一些地方需要修改。前端的代码不是我自己写的,是从网上下载的免费模板,在此感谢源码之家提供的免费模板,有兴趣的小伙伴可以取下一个来玩。本人第一次做项目,发到博客来和大家探讨学习,希望那些大神嘴下留情,不喜勿喷。

我还会继续更新我的毕设的,感谢大家支持。

转载于:https://www.cnblogs.com/zoroDu/p/6608099.html

零件库管理信息系统设计--part03:管理员登录部分设计相关推荐

  1. Spring+SpringMVC+MyBatis明日方舟版人员信息管理系统前端页面代码前后端交互+SSM框架 管理员登录 游客登录 普通用户登录 人员的增删改查 信息更新 图片上传 分页查询)

    Spring+SpringMVC+MyBatis明日方舟版人员信息管理系统前端页面代码(前后端交互+SSM框架 管理员登录 游客登录 普通用户登录 人员的增删改查 信息更新 图片上传 分页查询 修改密 ...

  2. Java学生信息管理系统——管理员登录模块(简单易上手)

    前言 这一篇是用来记录我编写学生信息管理系统时实现登录操作的过程,这是学生信息管理系统的第一个模块,之后我还会陆续将其它模块分享出来. 其它章节 ------------------------> ...

  3. 医院住院管理信息系统设计说明书+源码

    医院住院管理信息系统 一.绪论 1.1项目背景 随着人口的快速增长,我国的人口数量越来越多,随之而来的还有一系列的问题,其中一项就是就医问题.在人口基数大的基本情况下,医院单纯靠人力无法短时间解决这种 ...

  4. (附源码)基于Spring Boot的ERP仓储管理信息系统设计与实现 毕业设计150958

    基于Spring Boot的ERP仓储管理信息系统设计与实现 摘 要 科技进步的飞速发展引起人们日常生活的巨大变化,电子信息技术的飞速发展使得电子信息技术的各个领域的应用水平得到普及和应用.信息时代的 ...

  5. C#毕业设计——基于C#+asp.net+SQL server的网上物流管理信息系统设计与实现(毕业论文+程序源码)——网上物流管理信息系统

    基于C#+asp.net+SQL server的网上物流管理信息系统设计与实现(毕业论文+程序源码) 大家好,今天给大家介绍基于C#+asp.net+SQL server的网上物流管理信息系统设计与实 ...

  6. C#毕业设计——基于C#+vc.net+Access的报名管理信息系统设计与实现(毕业论文+程序源码)——报名管理信息系统

    基于C#+vc.net+Access的报名管理信息系统设计与实现(毕业论文+程序源码) 大家好,今天给大家介绍基于C#+vc.net+Access的报名管理信息系统设计与实现,文章末尾附有本毕业设计的 ...

  7. 【附源码】计算机毕业设计java养老院管理信息系统设计与实现

    项目运行 环境配置: Jdk1.8 + Tomcat7.0 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Eclispe,MyEclis ...

  8. 基于java物业管理信息系统设计(含源文件)

    欢迎添加微信互相交流学习哦! 项目源码:https://gitee.com/oklongmm/biye 基于B/S模式的物业管理信息系统设计 摘  要 随着市场经济的发展和人们生活水平的提高,大量的住 ...

  9. asp毕业设计—— 基于asp+access的客户管理信息系统设计与实现(毕业论文+程序源码)——客户管理信息系统

    基于asp+access的客户管理信息系统设计与实现(毕业论文+程序源码) 大家好,今天给大家介绍基于asp+access的客户管理信息系统设计与实现,文章末尾附有本毕业设计的论文和源码下载地址哦. ...

最新文章

  1. tab-pane 怎么家点击事件_有好转?辛巴燕窝事件新进展曝光。二子爷老婆首次回应银行行长送奥迪!二子爷分析小样你家老铁太精...
  2. android 属性动画失败,AndroidAnimationExercise
  3. java动态拼接String类sql
  4. [转]JS导出PDF
  5. jgit_JGit身份验证说明
  6. cepl进程 Linux,Ubuntu下NS2-2.33安装过程
  7. php入职头一星期,入职一周就想离职,真的是我太飘了吗?
  8. shell下的九大脚本实例
  9. java 百分比怎么比较_这88道阿里高级岗面试题,刷掉了80%以上的Java程序员
  10. SQL Server 2000中数据库质疑的恢复方法
  11. 两分钟实现安全完备的登录模块
  12. 【计算机的物理实现】电子科技的根源 - PN结
  13. ASP.NET 常用语句代码
  14. java 组件更新,java – 我可以批量处理一些Swing组件更新,以便重绘全部一次完成吗?...
  15. Ubuntu18.04操作系统sudo apt-get update报错
  16. Webx3 学习笔记
  17. oracle里如何求及格率,统计出每个教师每门课的及格人数和及格率
  18. 中国 移动短消息中心号码大全
  19. 蓝桥杯第十届c语言试题答案,[蓝桥杯][2019年第十届真题]空间跳跃 - C语言网
  20. AM5728调试经历

热门文章

  1. 好听的歌曲---爱情转移
  2. 如何在linux服务器上使用hanlp
  3. mount.nfs: Remote I/O error
  4. ***测试之情报收集
  5. 雅虎因性别歧视成被告 不过这次遭歧视的是男性
  6. iMX8方案服务-辰汉
  7. 小型自动化运维--expect脚本之自动同步
  8. 21.正则表达式的基本语法
  9. win7下编译uCOS-II
  10. 更换jdk Error:could not open '...jvm.cfg'解决方法