`
sharis1987
  • 浏览: 12295 次
  • 性别: Icon_minigender_2
  • 来自: 武汉
社区版块
存档分类
最新评论

基于springmvc+mybatis的shiro搭建实例

    博客分类:
  • ssh
阅读更多

 

1.导入以来的jar包,这里只列出关于shiro的

<dependency>

<groupId>org.apache.shiro</groupId>

<artifactId>shiro-core</artifactId>

<version>${shiro.version}</version>

</dependency>

<dependency>

<groupId>org.apache.shiro</groupId>

<artifactId>shiro-spring</artifactId>

<version>${shiro.version}</version>

</dependency>

<dependency>

<groupId>org.apache.shiro</groupId>

<artifactId>shiro-web</artifactId>

<version>${shiro.version}</version>

</dependency>

<dependency>

<groupId>org.apache.shiro</groupId>

<artifactId>shiro-ehcache</artifactId>

<exclusions>

<exclusion>

<groupId>net.sf.ehcache</groupId>

<artifactId>ehcache-core</artifactId>

</exclusion>

</exclusions>

<version>${shiro.version}</version>

</dependency>

 

2.编写配置文件 application-shiro.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:jee="http://www.springframework.org/schema/jee"

xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util"

xmlns:context="http://www.springframework.org/schema/context"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"

default-lazy-init="true">

 

<!--shiro的配置,关键两点,配置SecurityManager和依赖的RealM -->

<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">

<!-- <property name="cacheManager" ref="shiroEhcacheManager" /> -->

<property name="realm" ref="myRealm"/>

 

</bean>

 

<bean id="shiroSessionManager"

class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">

<!-- default:1 hours -->

<property name="globalSessionTimeout" value="3600000" />

<property name="sessionValidationScheduler" ref="sessionValidationScheduler" />

<property name="sessionValidationSchedulerEnabled" value="true" />

<property name="deleteInvalidSessions" value="false" />

</bean>

 

<!-- 用户授权信息Cache, 采用EhCache -->

<!-- <bean id="shiroEhcacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager"> -->

<!-- <property name="cacheManagerConfigFile" value="classpath:ehcache-shiro.xml" /> -->

<!-- </bean> -->

 

<!-- Shiro Filter -->

<!-- Shiro主过滤器本身功能十分强大,其强大之处就在于它支持任何基于URL路径表达式的、自定义的过滤器的执行 -->

<!-- Web应用中,Shiro可控制的Web请求必须经过Shiro主过滤器的拦截,Shiro对基于Spring的Web应用提供了完美的支持 -->

<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">

<!-- Shiro的核心安全接口,这个属性是必须的 -->

<property name="securityManager" ref="securityManager" />

<property name="loginUrl" value="/login" />

<property name="successUrl" value="/main" />

<property name="unauthorizedUrl" value="/login" />

<property name="filterChainDefinitions">

<value>

/login = anon

/js/**=anon

/** =authc

</value>

</property>

</bean>

<bean id="myRealm" class ="com.util.OracleJdbcRealm">

</bean>

</beans>

 

3.编写com.util.OracleJdbcRealm继承JdbcRealm,主要是编写获取认证信息和授权信息方法

package com.util;

 

import java.util.List;

 

import org.apache.shiro.SecurityUtils;

import org.apache.shiro.authc.AuthenticationException;

import org.apache.shiro.authc.AuthenticationInfo;

import org.apache.shiro.authc.AuthenticationToken;

import org.apache.shiro.authc.SimpleAuthenticationInfo;

import org.apache.shiro.authc.UsernamePasswordToken;

import org.apache.shiro.authz.AuthorizationInfo;

import org.apache.shiro.authz.SimpleAuthorizationInfo;

import org.apache.shiro.realm.jdbc.JdbcRealm;

import org.apache.shiro.session.Session;

import org.apache.shiro.subject.PrincipalCollection;

import org.apache.shiro.subject.Subject;

import org.apache.shiro.util.ByteSource;

import org.springframework.beans.factory.annotation.Autowired;

 

import com.dao.entity.Operator;

import com.dao.entity.OperatorRole;

import com.dao.entity.UserInfo;

import com.service.SystemPersonnelCollectionService;

 

public class OracleJdbcRealm extends JdbcRealm {

 

@Autowired

private SystemPersonnelCollectionService loginService;

//认证信息

@Override

protected AuthenticationInfo doGetAuthenticationInfo(

AuthenticationToken auToken) throws AuthenticationException {

UsernamePasswordToken token = (UsernamePasswordToken) auToken;

String userName = token.getUsername();

 

try {

Operator user = loginService.getOperatorByOperatorNo(token

.getUsername());

 

System.out.println("userName:" + user.getOperatorNo());

if (user != null) {

SimpleAuthenticationInfo sai = new SimpleAuthenticationInfo(

userName, user.getOperatorPassword(), getName());

sai.setCredentialsSalt(ByteSource.Util.bytes(userName));

/**

* 将用户信息放到session

*/

UserInfo userInfo = new UserInfo();

userInfo.setOperator(user);

userInfo.setIp(token.getHost());

setSession("USER_INFO", userInfo);

return sai;

} else {

return null;

}

} catch (Exception e) {

throw new AuthenticationException(e.getMessage(), e);

}

}

 

private void setSession(Object key, Object value) {

Subject currentUser = SecurityUtils.getSubject();

if (null != currentUser) {

Session session = currentUser.getSession();

if (null != session) {

session.setAttribute(key, value);

}

}

}

 

//授权信息

@Override

protected AuthorizationInfo doGetAuthorizationInfo(

PrincipalCollection principals) {

 

UserInfo userInfo = SpringSecurityUtils.getCurrentUser();

 

List<OperatorRole> operatorRoles = loginService

.getRoleByOperatorId(String.valueOf(userInfo.getOperatorId()));

SimpleAuthorizationInfo simpleAuthorizationInfo = new SimpleAuthorizationInfo();

for (OperatorRole role : operatorRoles) {// 添加角色

simpleAuthorizationInfo.addRole(role.getRoleName());

}

// 设置网格操作权限

// if(userInfo.getGridId() != null){}

// if (simpleAuthorizationInfo.getRoles().contains("admin")

// || userInfo.getGridId() != null) {

// simpleAuthorizationInfo.addStringPermissions(loginService

// .findAllChildGridById("grid:edit:", userInfo.getGridId()));

// }

return simpleAuthorizationInfo;

}

 

}

 

4.编写mybatis连接数据库需要的Java类和映射文件

OperatorMapper.xml文件内容如下:

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >

<mapper namespace="com.dao.mapper.OperatorMapper">

<resultMap id="result_getOperatorByOperatorNo" type="com.dao.entity.Operator">

<id property="operatorId" column="OPERATOR_ID" />

<result property="employeeId" column="EMPLOYEE_ID" />

<result property="operatorNo" column="OPERATOR_NO" />

<result property="operatorType" column="OPERATOR_TYPE" />

<result property="operatorPassword" column="OPERATOR_PASSWORD" />

<result property="operatorStatus" column="OPERATOR_STATUS" />

<result property="createTime" column="CREATE_TIME" />

<result property="modifyTime" column="MODIFY_TIME" />

<result property="gridId" column="GRID_ID" />

<result property="operatorName" column="OPERATOR_NAME" />

<result property="operatorTel" column="OPERATOR_TEL" />

<result property="operatorEmail" column="OPERATOR_EMAIL" />

<result property="gridOpType" column="GRID_OP_TYPE" />

<result property="gridOpImg" column="GRID_OP_IMG" />

</resultMap>

 

<sql id="operator_column">

OPERATOR_ID, EMPLOYEE_ID, OPERATOR_NO, OPERATOR_TYPE,

OPERATOR_PASSWORD, OPERATOR_STATUS, CREATE_TIME, MODIFY_TIME,

GRID_ID,

OPERATOR_NAME, OPERATOR_TEL, OPERATOR_EMAIL, GRID_OP_TYPE,GRID_OP_IMG

</sql>

<!-- 根据用户名获取操作员信息 -->

<select id="getOperatorByOperatorNo" parameterType="string"

resultMap="result_getOperatorByOperatorNo">

SELECT

<include refid="operator_column" />

FROM T_OPERATOR WHERE OPERATOR_NO= #{operatorNo}

</select>

 

<resultMap id="result_getRoleByOperatorId"

type="com.dao.entity.OperatorRole">

<id property="operatorRoleId" column="OPERATOR_ROLE_ID" />

<result property="operatorId" column="OPERATOR_ID" />

<result property="roleId" column="ROLE_ID" />

<result property="roleName" column="ROLE_NAME" />

</resultMap>

<select id="getRoleByOperatorId" resultMap="result_getRoleByOperatorId">

SELECT

OPERATOR_ROLE_ID,OPERATOR_ID,ROLE_ID,(SELECT ROLE_NAME FROM T_ROLE

WHERE ROLE_ID = TOR.ROLE_ID) ROLE_NAME

FROM T_OPERATOR_ROLE TOR

WHERE

OPERATOR_ID = #{operatorId}

</select>

 

</mapper>

 

com.dao.entity.Operator实体类:

 

package  com.dao.entity;

 

import java.io.Serializable;

import java.util.Date;

 

public class Operator implements Serializable{

/**

*/

private static final long serialVersionUID = 7642745218798808968L;

private Long operatorId; // 操作员ID 

private Long employeeId; // 员工ID 

private String operatorNo; // 操作员账号 

private String operatorType; // 1系统管理员;2网格管理员;3:网格操作员

private String operatorPassword; // 登陆口令

private String operatorStatus = "1"; // 操作员状态1有效0归档 

private Date createTime; // 创建时间 

private Date modifyTime; // 修改时间

private Long gridId;//网格操作员所属的网格

private String operatorName; // 操作员名称 

private String operatorTel; // 操作员电话

private String operatorEmail; // 操作员邮箱 

private String operatorRoleId; //操作员角色

private String gridOpType; //网格员类型1: 网格管理员(社区居委管理人员)、2: 网格协管员(机关包片干部)、3: 网格警务员(片警)、4:网格监督员

private String gridOpImg;//网格员照片URL

/**

* 获取 操作员ID

*/

public Long getOperatorId(){

return this.operatorId;

}

 

/**

* 设置 操作员ID

*/

public void setOperatorId(Long operatorId){

this.operatorId=operatorId;

}

 

/**

* 获取 员工ID

*/

public Long getEmployeeId(){

return this.employeeId;

}

 

/**

* 设置 员工ID

*/

public void setEmployeeId(Long employeeId){

this.employeeId=employeeId;

}

 

/**

* 获取 操作员账号

*/

public String getOperatorNo(){

return this.operatorNo;

}

 

/**

* 设置 操作员账号

*/

public void setOperatorNo(String operatorNo){

this.operatorNo=operatorNo;

}

 

/**

* 获取 1管理员2业务操作员

*/

public String getOperatorType(){

return this.operatorType;

}

 

/**

* 设置 1管理员2业务操作员

*/

public void setOperatorType(String operatorType){

this.operatorType=operatorType;

}

 

/**

* 获取 登陆口令LGN_PWD

*/

public String getOperatorPassword(){

return this.operatorPassword;

}

 

/**

* 设置 登陆口令LGN_PWD

*/

public void setOperatorPassword(String operatorPassword){

this.operatorPassword=operatorPassword;

}

 

/**

* 获取 操作员状态OP_STT1有效0归档

*/

public String getOperatorStatus(){

return this.operatorStatus;

}

 

/**

* 设置 操作员状态OP_STT1有效0归档

*/

public void setOperatorStatus(String operatorStatus){

this.operatorStatus=operatorStatus;

}

 

/**

* 获取 null

*/

public Date getCreateTime(){

return this.createTime;

}

 

/**

* 设置 null

*/

public void setCreateTime(Date createTime){

this.createTime=createTime;

}

 

/**

* 获取 null

*/

public Date getModifyTime(){

return this.modifyTime;

}

 

/**

* 设置 null

*/

public void setModifyTime(Date modifyTime){

this.modifyTime=modifyTime;

}

 

public String getOperatorName() {

return operatorName;

}

 

public void setOperatorName(String operatorName) {

this.operatorName = operatorName;

}

 

public String getOperatorTel() {

return operatorTel;

}

 

public void setOperatorTel(String operatorTel) {

this.operatorTel = operatorTel;

}

 

public String getOperatorEmail() {

return operatorEmail;

}

 

public void setOperatorEmail(String operatorEmail) {

this.operatorEmail = operatorEmail;

}

 

public String getOperatorRoleId() {

return operatorRoleId;

}

 

public void setOperatorRoleId(String operatorRoleId) {

this.operatorRoleId = operatorRoleId;

}

 

public Long getGridId() {

return gridId;

}

 

public void setGridId(Long gridId) {

this.gridId = gridId;

}

 

public String getGridOpType() {

return gridOpType;

}

 

public void setGridOpType(String gridOpType) {

this.gridOpType = gridOpType;

}

 

public String getGridOpImg() {

return gridOpImg;

}

 

public void setGridOpImg(String gridOpImg) {

this.gridOpImg = gridOpImg;

}

 

public String toString(){

StringBuffer sb = new StringBuffer();

sb.append("operatorId="+operatorId).append(";");

sb.append("employeeId="+employeeId).append(";");

sb.append("operatorNo="+operatorNo).append(";");

sb.append("operatorType="+operatorType).append(";");

sb.append("operatorPassword="+operatorPassword).append(";");

sb.append("operatorStatus="+operatorStatus).append(";");

sb.append("createTime="+createTime).append(";");

sb.append("modifyTime="+modifyTime).append(";");

sb.append("operatorName="+operatorName).append(";");

sb.append("operatorTel="+operatorTel).append(";");

sb.append("operatorEmail="+operatorEmail).append(";");

sb.append("gridOpType="+gridOpType).append(";");

sb.append("gridOpImg="+gridOpImg).append(";");

return sb.toString();

}

 

}

com.dao.entity.OperatorRole实体类:

package  com.dao.entity;

 

import java.io.Serializable;

 

public class OperatorRole implements Serializable{

 

/**

*/

private static final long serialVersionUID = -7384310951225091546L;

 

private Long operatorRoleId; // ID

private String operatorId; // 操作员ID

private String roleId; // 角色代码 

private String roleName;

public Long getOperatorRoleId() {

return operatorRoleId;

}

public void setOperatorRoleId(Long operatorRoleId) {

this.operatorRoleId = operatorRoleId;

}

public String getOperatorId() {

return operatorId;

}

public void setOperatorId(String operatorId) {

this.operatorId = operatorId;

}

public String getRoleId() {

return roleId;

}

public void setRoleId(String roleId) {

this.roleId = roleId;

}

public String getRoleName() {

return roleName;

}

public void setRoleName(String roleName) {

this.roleName = roleName;

}

 

 

}

 

com.dao.mapper.OperatorMapper接口:

package com.dao.mapper;

 

import java.util.List;

import java.util.Map;

 

import org.apache.ibatis.annotations.Param;

import org.apache.ibatis.session.RowBounds;

 

import com.dao.entity.Operator;

import com.dao.entity.OperatorRole;

 

/**

 * 系统菜单

 * 

 * @author cykj

 * 

 */

public interface OperatorMapper {

/**

* 根据用户名获取操作员信息

* @param operatorNo

* @return

*/

Operator getOperatorByOperatorNo(String operatorNo);

 

/**

* 查询用户角色

* @param operatorId

* @return

*/

public List<OperatorRole> getRoleByOperatorId(String operatorId);

 

}

 

 

6.编写服务接口和服务类

接口

package com.service;

 

import java.util.List;

 

import com.dao.entity.Operator;

import com.dao.entity.OperatorRole;

 

 

/**

 * 系统人员管理大接口____________服务端

 */

public interface SystemPersonnelCollectionService {

 

/**

* 根据操作员工号取得操作员信息

* @param operatorNo

* @return

*/

public Operator getOperatorByOperatorNo(String operatorNo); // 测试

 

/**

* 查询用户对应的角色

* @param operatorId

* @return

*/

public List<OperatorRole> getRoleByOperatorId(String operatorId);

 

}

 

 

实现类:

package com.service.impl;

 

import java.util.List;

 

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

 

import com.dao.entity.Operator;

import com.dao.entity.OperatorRole;

import com.dao.mapper.OperatorMapper;

import com.service.SystemPersonnelCollectionService;

 

@Service("loginService")

public class SystemPersonnelCollectionServiceImpl implements

SystemPersonnelCollectionService {

 

@Autowired

OperatorMapper operatorMapper;

 

@Override

public Operator getOperatorByOperatorNo(String operatorNo) {

return operatorMapper.getOperatorByOperatorNo(operatorNo);

}

 

@Override

public List<OperatorRole> getRoleByOperatorId(String operatorId) {

return operatorMapper.getRoleByOperatorId(operatorId);

}

 

}

 

7.编写前台登陆界面和controller

前台登陆界面 login.jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8"%>

<html>

<head>

<title>登陆</title>

<link href="/js/easyui-1.3.6/themes/default/easyui.css" rel="stylesheet"

type="text/css" />

<link href="/js/easyui-1.3.6/themes/icon.css" rel="stylesheet"

type="text/css" />

<script src="/js/jquery-1.9.1.min.js" type="text/javascript"></script>

<script src="/js/easyui-1.3.6/jquery.easyui.min.js"

type="text/javascript"></script>

</head>

<body>

<div class="box">

<div class="login">

<form id="loginForm" method="post" class="form">

<table border="0" cellpadding="0" cellspacing="0">

<tr>

<td style="font-size: 16px; color: #0e7b9a; font-weight: bold;">用户名:</td>

<td style="padding-left: 10px;" colspan="2"><input

type="text" id="username" name="username" class="text"

onkeydown="if(event.keyCode==13)$('#password').focus();"></td>

</tr>

<tr>

<td style="font-size: 16px; color: #0e7b9a; font-weight: bold;">密

码:</td>

<td style="padding-left: 10px;" colspan="2"><input

type="password" id="password" name="password"

onkeydown="if(event.keyCode==13)loginFun();" class="text"></td>

</tr>

<tr>

<td></td>

<td colspan="2" style="padding-left: 10px;"><input

type="button" onclick="loginFun()" class="button" value="登  陆"><input

type="reset" class="button" value="清  空"

style="margin-left: 32px;"></td>

</tr>

</table>

</form>

 

</div>

<div id="errorMessages" class="tips"></div>

</div>

</body>

</html>

<script type="text/javascript">

function loginFun() {

var $form = $('#loginForm');//选中的tab里面的form

 

$.post('/login', $form.serialize(), function(data) {

alert(data.success);

if (data.success) {

alert("alert");

self.location.href = 'main';

} else {

$('#errorMessages').html("&nbsp;" + data.msg).show();

}

}, 'json');

 

}

</script>

 

登陆成功后的main.jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8"%>

<html>

<head>

<title>登陆成功</title>

</head>

<body>

 登陆成功

</body>

</html>

 

 

controller 类:

package com.controller;

 

import java.io.PrintWriter;

 

import javax.servlet.http.HttpServletRequest;

 

import org.apache.shiro.SecurityUtils;

import org.apache.shiro.authc.UsernamePasswordToken;

import org.apache.shiro.subject.Subject;

import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;

 

import com.google.gson.Gson;

import com.util.SpringSecurityUtils;

 

@Controller

public class LoginController {

 

@RequestMapping(value="login",method=RequestMethod.POST)

public void login(HttpServletRequest request,PrintWriter out){

String userName = request.getParameter("username");

String password = request.getParameter("password");

String pass = SpringSecurityUtils.generatePassword(userName, password);

 

Subject subject = SecurityUtils.getSubject();

         subject.login(new UsernamePasswordToken(userName, pass));

         Gson gson = new Gson();

         if(subject.isAuthenticated()){

        String success = "true";

       

        out.print("{\"success\":\"true\"}");

         }

 

       

 

}

 

 

@RequestMapping(value = "login", method = RequestMethod.GET)

public String showLoginForm() {

return "login";

}

 

@RequestMapping("main")

public String showMain(){

return "main";

}

 

}

 

详细的源码见附件

 

 

 

 

 

分享到:
评论

相关推荐

    springMVC+mybatis+shiro+redis 项目整合demo

    这个"springMVC+mybatis+shiro+redis 项目整合demo"就是一个实例,展示了如何将这些技术集成到一个项目中,以实现高效的数据处理、用户认证授权和缓存管理。 首先,`SpringMVC` 是 Spring 框架的一部分,它是一个...

    maven+SpringMvc+Mybatis+shiro安全框架整合实例(-)

    本实例主要探讨的是"Maven+SpringMVC+MyBatis+Shiro"的整合,这是一个常见的Java Web开发组合,用于实现高效、安全的业务逻辑处理。让我们逐一解析这些框架及其在项目中的作用。 1. Maven: Maven是Apache软件基金...

    Spirng+SpringMVC+Maven+Mybatis+MySQL+tomcat实例

    这是一个基于Java技术栈的经典组合——SSM框架(Spring、SpringMVC、Mybatis)与Maven构建工具,以及MySQL数据库和Tomcat应用服务器的实践项目。这个实例将带你深入理解这些技术如何协同工作,构建一个完整的Web应用...

    springMVC+spring+mybatis(shiro+redis)框架样本

    这个"springMVC+spring+mybatis(shiro+redis)框架样本"是一个综合性的项目实例,它整合了这五个关键组件,为开发者提供了一个全面的权限管理和数据访问解决方案。 1. **Spring框架**:Spring是Java企业级应用的...

    shiro+springmvc+mybatis+maven

    【标题】"Shiro+SpringMVC+MyBatis+Maven"的集成与实践 在Web开发领域,Shiro、SpringMVC、MyBatis和Maven这四个组件是常见的技术栈,它们各司其职,共同构建了一个强大且灵活的后端系统。这个实例结合了这些工具,...

    Spring+SpringMVC+MyBatis整合工程完整实例及实现用户登录功能

    SSM(Spring、SpringMVC、MyBatis)框架整合是Java Web开发中常见的技术栈,它将Spring的依赖注入、SpringMVC的MVC设计模式以及MyBatis的持久层框架结合在一起,构建出高效、灵活的Web应用。本项目以一个完整的实例...

    OA协同办公与管理系统(毕业设计)Spring+SpringMVC+Mybatis+Shiro+JqueryEasyUI.zip

    本项目以“OA协同办公与管理系统”为研究对象,采用先进的技术栈Spring、SpringMVC、Mybatis、Shiro和JqueryEasyUI,构建了一个高效、易用、安全的毕业设计实例。下面将详细解析这些技术在系统中的应用。 1. **...

    基于 SpringBoot + Spring + SpringMvc + Mybatis + Shiro+ Redi.zip

    这是一个基于Java技术栈的Web应用项目,主要使用了SpringBoot、Spring、SpringMVC、Mybatis、Shiro和Redis这六个核心组件。下面将详细解释这些技术及其在项目中的作用。 1. **SpringBoot**: SpringBoot是Spring框架...

    SpringMVC+Mybatis+Spring+Shiro+ehcache整合配置文件

    SpringMVC、Mybatis、Spring、Shiro和Ehcache这五个技术组件是Java Web开发中的关键工具,它们各自承担着不同的职责,并通过整合来实现强大的功能。下面将详细阐述这些技术以及它们在整合中的作用。 首先,...

    shiro+maven+sringMVC+mybatis

    在"Shiro + Maven + SpringMVC + MyBatis"的实例中,Maven负责下载并管理所有必要的库,包括Shiro、SpringMVC和MyBatis的依赖,确保项目构建的顺利进行。 **SpringMVC**: SpringMVC是Spring框架的一部分,是一个...

    拍卖系统 spring+springmvc+mybatis+jsp

    【标题】"拍卖系统 spring+springmvc+mybatis+jsp" 涉及的主要知识点是基于Java技术栈的Web开发,具体包括Spring、SpringMVC、MyBatis和JSP等核心组件。以下是对这些技术及其在拍卖系统中的应用进行的详细解释: 1....

    Springmvc+mybatis框架整合源码下载

    整合Spring MVC和MyBatis可以让开发更高效,Spring通过依赖注入(DI)管理MyBatis的SqlSessionFactory和Mapper接口实例。使用`@Autowired`注解,可以自动将SqlSession和Mapper注入到需要的地方,简化代码。 1. **...

    Java基于SSM(Spring+SpringMVC+MyBatis)大创项目申报管理系统.zip

    这个项目"Java基于SSM(Spring+SpringMVC+MyBatis)大创项目申报管理系统"是一个典型的企业级应用实例,用于管理大学生创新项目申报。下面将详细解释这三个框架及其在项目中的作用。 **Spring框架**:Spring是一个...

    Java基于SSM(Spring+SpringMVC+MyBatis)新农大校园论坛系统.zip

    SSM框架是Java开发Web应用时常用的...以上就是关于“Java基于SSM(Spring+SpringMVC+MyBatis)新农大校园论坛系统”的核心知识点。这个系统展示了SSM框架在实际开发中的应用,以及如何构建一个功能完善的校园论坛平台。

    SSM(Spring+SpringMVC+Mybatis)博客系统2.zip

    SSM(Spring、SpringMVC和Mybatis)是Java企业级开发中常用的一个技术栈,它结合了Spring的IoC(Inversion of Control,控制反转)和AOP(Aspect Oriented Programming,面向切面编程)功能,SpringMVC作为表现层...

    java-mybatis、springmvc 整合demo源码(druid-demo)

    在Java开发领域,MyBatis和SpringMVC是两个非常重要的框架。MyBatis是一个优秀的持久层框架,它支持定制化SQL、存储过程以及高级映射。SpringMVC则是Spring框架的一部分,主要用于处理Web应用程序的请求和响应。当这...

    jeesite1.2.7 springMVC+mybatis 开源下载

    JeeSite本身是以Spring Framework为核心容器,Spring MVC为模型视图控制器,MyBatis为数据访问层, Apache Shiro为权限授权层,Ehcahe对常用数据进行缓存,Activit为工作流引擎。 JeeSite主要定位于企业信息化领域,...

    shiro_01:springmvc+mybatis+shrio整合

    【标题】"shiro_01:springmvc+mybatis+shrio整合"指的是一个项目实例,该实例展示了如何将SpringMVC、MyBatis和Apache Shiro这三大框架进行集成,以实现一个完整的Web应用的身份认证和授权功能。Apache Shiro是一个...

Global site tag (gtag.js) - Google Analytics