SSM框架实现基本的登录注册功能

该博客介绍了如何利用SSM(Spring、SpringMVC、MyBatis)框架实现登录注册功能,包括所需的jar包配置,详细讲解了六层架构(controller、dao、model、service、service.impl、mapper),并提供了四个关键配置文件(applicationContext.xml、log4j.properties、mybatis-config.xml、spring-mvc.xml)的内容和作用。
摘要由CSDN通过智能技术生成

http://denglu.png

1.ssm框架需要的jar包

链接:https://pan.baidu.com/s/1iErZoHZmKBPhAIm5lqFbVQ 
提取码:4ssj 

SSM
包括六层架构
1 controller层
2 dao层
3 model层
4 service层
5 service.impl层
6 mapper层
其中用到mvc注解的有controller层和serviceImpl层
首先controller层需要注解 @controller
然后表单对应的层 @RequestMapping("/user")
然后controller类对应的方法也要加对应的@RequestMapping("/方法名")
引用某层的,必须注解加@Resource

而 ServiceImpl层类前面先加上@Service("/父接口") ;引入哪层必须加@Resource

2 配置文件  四个配置文件

2.1 applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>    
<beans xmlns="http://www.springframework.org/schema/beans"    
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
    xmlns:p="http://www.springframework.org/schema/p"  
    xmlns:aop="http://www.springframework.org/schema/aop"   
    xmlns:context="http://www.springframework.org/schema/context"  
    xmlns:jee="http://www.springframework.org/schema/jee"  
    xmlns:tx="http://www.springframework.org/schema/tx"  
    xsi:schemaLocation="    
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd  
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd  
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd  
        http://www.sprin

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值