Apache Shiro权限框架在SpringMVC+Hibernate中的应用

maven+springMVC+mybatis+junit详细搭建过程整合实现demo,带有jar包和测试类。增删改查的操作供大家学习。 maven+springMVC+mybatis+junit详细搭建过程整合实现demo,带有jar包和测试类。增删改查的操作供大家学习。内含数据库文件! 立即下载

Apache Shiro权限框架在SpringMVC+Hibernate中的应用

开源中国
开源中国
发表于 2014-08-23 00:11:52

       在做网站开发中,用户权限必须要考虑的,权限这个东西很重要,它规定了用户在使用中能进行哪些操作,和不能进行哪些操作;我们完全可以使用过滤器来进行权限的操作,但是有了权限框架之后,使用起来会非常的方便,一般在公司里面做网站开发常用的权限框架有Spring的Security框架,和Apache的Shiro框架;Spring Security框架在使用上相比Shiro来说要更复杂一些,并且它限制了数据库该怎么去建表,只有按它的要求去建表,才能达到你想要的效果。下面我主要介绍一下Shiro框架的使用,由于本人也是初学者,所写难免会有些不合理的地方,望各位指正;

       使用Apache Shiro框架的步骤:

1.导入相应的jar包,我使用的是maven来管理的,pom.xml配置如下:

<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.kaishengit</groupId>
<artifactId>springmvctest</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
 <name>springmvctest Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>


<groupId>jstl</groupId>


<artifactId>jstl</artifactId>


<version>1.2</version>

</dependency>
<dependency>


<groupId>javax.servlet</groupId>


<artifactId>servlet-api</artifactId>


<version>2.5</version>

</dependency>
<dependency>


<groupId>org.springframework</groupId>


<artifactId>spring-webmvc</artifactId>


<version>3.2.4.RELEASE</version>

</dependency>
<dependency>


<groupId>org.codehaus.jackson</groupId>


<artifactId>jackson-mapper-asl</artifactId>


<version>1.9.10</version>

</dependency>

<dependency>


<groupId>commons-fileupload</groupId>


<artifactId>commons-fileupload</artifactId>


<version>1.3</version>

</dependency>

<dependency>


<groupId>org.springframework</groupId>


<artifactId>spring-jdbc</artifactId>


<version>3.2.4.RELEASE</version>

</dependency>


<dependency>


<groupId>org.springframework</groupId>


<artifactId>spring-orm</artifactId>


<version>3.2.4.RELEASE</version>

</dependency>

<!-- Hibernate -->

<dependency>


<groupId>org.hibernate</groupId>


<artifactId>hibernate-core</artifactId>


<version>4.2.5.Final</version>

</dependency>

<dependency>


<groupId>org.hibernate</groupId>


<artifactId>hibernate-ehcache</artifactId>


<version>4.2.5.Final</version>

</dependency>

<dependency>


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


<artifactId>ehcache</artifactId>


<version>2.7.2</version>

</dependency>

<dependency>


<groupId>commons-dbcp</groupId>


<artifactId>commons-dbcp</artifactId>


<version>1.4</version>

</dependency>
<dependency>


<groupId>mysql</groupId>


<artifactId>mysql-connector-java</artifactId>


<version>5.1.26</version>

</dependency>

<dependency>


<groupId>javax.inject</groupId>


<artifactId>javax.inject</artifactId>


<version>1</version>

</dependency>

<dependency>


<groupId>org.hibernate</groupId>


<artifactId>hibernate-validator</artifactId>


<version>5.0.1.Final</version>

</dependency>
 <!--Apache Shiro所需的jar包-->

<dependency>

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

<artifactId>shiro-core</artifactId>

<version>1.2.2</version>

</dependency>

<dependency>

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

<artifactId>shiro-web</artifactId>

<version>1.2.2</version>

</dependency>

<dependency>

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

<artifactId>shiro-spring</artifactId>

<version>1.2.2</version>

</dependency>


</dependencies>
<build>
<finalName>springmvctest</finalName>
<plugins>

<plugin>


<groupId>org.mortbay.jetty</groupId>


<artifactId>jetty-maven-plugin</artifactId>


<configuration>


<scanIntervalSeconds>10</scanIntervalSeconds>


<webApp>


<contextPath>/</contextPath>


</webApp>


<connectors>


 <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">


<port>80</port>


<maxIdleTime>60000</maxIdleTime>


</connector>


</connectors>


</configuration>


</plugin>
</plugins>
</build>
</project>

2.在web.xml中进行配置:

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

xmlns="http://java.sun.com/xml/ns/javaee"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
 <display-name>Archetype Created Web Application</display-name>

 <!-- OpenSessionInView -->
<filter>

<filter-name>opensessioninview</filter-name>

<filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>

<filter-name>opensessioninview</filter-name>

<url-pattern>/*</url-pattern>
</filter-mapping>

 <!-- SpringMVC中央控制器 -->
<servlet>

<servlet-name>mvc</servlet-name>

<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>

<servlet-name>mvc</servlet-name>

<url-pattern>/</url-pattern>
</servlet-mapping>

 <!-- Spring监听器 -->
<context-param>

<param-name>contextConfigLocation</param-name>

<param-value>classpath:applicationContext*.xml</param-value>
</context-param>
<listener>

<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
 <!-- Shiro配置 -->
<filter>

<filter-name>shiroFilter</filter-name>

<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>

<filter-name>shiroFilter</filter-name>

<url-pattern>/*</url-pattern>
</filter-mapping>

</web-app>

3.使用SpringMVC:在/WEB-INF/路径下配置springmvc-servlet.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:context="http://www.springframework.org/schema/context"

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

xsi:schemaLocation="

http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans.xsd

http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context.xsd

http://www.springframework.org/schema/mvc

http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

<!-- 自动扫描 -->

<context:component-scan base-package="com.kaishengit.controller">


<context:include-filter type="annotation"expression="org.springframework.stereotype.Controller"/>

</context:component-scan>

<mvc:annotation-driven/>

<!-- 静态资源访问 -->

<mvc:resources location="/static/"mapping="/static/**"/>

<!-- 视图解析器 -->

<bean id="viewResolver"class="org.springframework.web.servlet.view.UrlBasedViewResolver">


<property name="viewClass"value="org.springframework.web.servlet.view.JstlView"/>


<property name="prefix"value="/WEB-INF/views/"/>


<property name="suffix"value=".jsp"/>

</bean>

<!-- 文件上传解析器 -->

<bean id="multipartResolver"class="org.springframework.web.multipart.commons.CommonsMultipartResolver">


<!-- 配置最大上传文件的大小 -->


<property name="maxUploadSize"value="1000000"/>

</bean>

<!-- 拦截器 -->

<mvc:interceptors>


<mvc:interceptor>



<mvc:mapping path="/**"/>



<bean class="com.kaishengit.controller.MyInterceptor">




<property name="excluedUrls">





<list>






<value>/home</value>





</list>




</property>



</bean>


</mvc:interceptor>

</mvc:interceptors>

<!-- 异常 -->

<bean id="handlerExceptionResolver"class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">


<property name="exceptionMappings">



<props>




<prop key="com.kaishengit.exception.AuthorizationException">redirect:/home</prop>



</props>


</property>




</bean>
</beans>

 4.配置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:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">



<!-- 自动扫描所有的注解,排除掉controller不扫描 -->

<context:component-scan base-package="com.kaishengit">


<context:exclude-filter type="annotation"expression="org.springframework.stereotype.Controller"/>

</context:component-scan>



<!-- 加载ClassPath中的properties文件 -->

<context:property-placeholder location="classpath:jdbc.properties"/>



<!-- 基于Hibernate的事务管理器 -->

<bean id="transactionManager"class="org.springframework.orm.hibernate4.HibernateTransactionManager">


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

</bean>



<!-- 配置数据源 -->

<bean id="dataSource"class="org.apache.commons.dbcp.BasicDataSource"destroy-method="close">


<property name="driverClassName"value="${jdbc.driver}"/>


<property name="url"value="${jdbc.url}"/>


<property name="username"value="${jdbc.username}"/>


<property name="password"value="${jdbc.password}"/>

</bean>

<!-- 基于注解 -->

<tx:annotation-driven transaction-manager="transactionManager"/>

<!-- SessionFactory -->

<bean id="sessionFactory"class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">


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


<!-- 实体类pojo所在的包 -->


<property name="packagesToScan"value="com.kaishengit.pojo"/>


<property name="hibernateProperties">



<props>




<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>




<prop key="hibernate.show_sql">true</prop>




<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop>



</props>


</property>

</bean>
</beans>

5.将配置在applicationContext.xml中的shiro独立出来,新建applicationContext-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:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">



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


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


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

</bean>



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


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


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


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


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


<property name="filterChainDefinitions">



<value>
<!--静态资源直接通过-->




/static/** =anon
<!--只有admin角色才能访问/user/save-->




/user/save =roles[admin]
<!--具有user:add权限的用户可以访问/user/save-->




<!--/user/save =perms[user:add]-->
<!--所有的请求都要通过验证-->




/** = authc



</value>


</property>

</bean>


<bean id="cacheManager"


class="org.apache.shiro.cache.MemoryConstrainedCacheManager"/>

<bean id="lifecycleBeanPostProcessor"


class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>


</beans>

 6.实现MyRealm:继承AuthorizingRealm,并重写认证授权方法 

package com.kaishengit.service;

import java.util.List;

import javax.inject.Inject;

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.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kaishengit.pojo.Role;
import com.kaishengit.pojo.User;

@Service
@Transactional
public class MyRealm extends AuthorizingRealm{


@Inject

private UserService userService;

/**

 * 权限认证

*/

@Override

protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {


//获取登录的用户名


String loginName=(String) principalCollection.fromRealm(getName()).iterator().next();


User user=userService.findByName(loginName);


if(user!=null){



SimpleAuthorizationInfo info=new SimpleAuthorizationInfo();



//登录的用户有多少个角色



info.setRoles(user.getRolesName());



List<Role> roleList=user.getRoleList();



for(Role role:roleList){




//角色有多少个权限




info.addStringPermissions(role.getPermissionNames());



}



return info;


}


return null;

}


/**

 * 登录认证

*/

@Override

protected AuthenticationInfo doGetAuthenticationInfo(



AuthenticationToken authenticationToken) throws AuthenticationException {


UsernamePasswordToken token = (UsernamePasswordToken) authenticationToken;


User user = userService.findByName(token.getUsername());


if(user != null) {



return new SimpleAuthenticationInfo(user.getUsername(), user.getPassword(), getName());


}


return null;

}

}

7.HomeController.java

package com.kaishengit.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

import com.kaishengit.pojo.User;

@Controller
public class HomeController {


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

public String loginForm(){


return"/login";

}

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

public String login(User user,RedirectAttributes redirectAttributes){


try {



SecurityUtils.getSubject().login(new UsernamePasswordToken(user.getUsername(), user.getPassword()));



return"redirect:/user";


} catch (AuthenticationException e) {



redirectAttributes.addFlashAttribute("message","用户名或密码错误");



return"redirect:/login";


}

}

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

public String logout(RedirectAttributes redirectAttributes ){


SecurityUtils.getSubject().logout();


redirectAttributes.addFlashAttribute("message","您已安全退出");


return"redirect:/login";

}
}

 8.在jsp中使用Shiro标签库:

<%@ taglib prefix="shiro"uri="http://shiro.apache.org/tags"%>

<html>

   <head>

      <title>page</title>

   </head>

   <body>

        <!--显示登录的用户名-->

        <h2>welcome!<shiro:principal/></h2>

  <a href="/logout">安全退出</a>

        <!--角色为manager的用户登录后会显示添加按钮,否则不显示-->

  <shiro:hasRole name="manager">

  <a href="/user/save">添加</a>

  </shiro:hasRole>                                                              

    </body>                                                    

</html>

9.数据库中建表,E-R图如下:

maven-spring-restful-test maven项目模版,里面有springMVC配置restful的后台代码例子,使用spring-test单元测试。 立即下载

相关推荐

手把手教你用若依WMS搭建企业级仓库管理系统(Vue+Spring Boot实战)

本文提供了一份基于若依框架(RuoYi)快速搭建企业级仓库管理系统(WMS)的实战指南。详细介绍了从环境准备、项目初始化到核心功能模块(如入库流程、库存管理看板)深度定制的全过程,并涵盖Lodop打印集成、移动端PWA适配及生产环境Docker部署等高级主题,帮助开发者高效构建稳定可用的WMS系统。

weixin_29015899的博客 562

SpringMVC+spring+Mybatis+Maven框架搭建

课程包含六个部分:相关软件和数据库环境准备Generator(命令行、maven、eclipse插件)Spring和mybatis整合Spring和mybatis整合后测试Spring mvc整合Spring mvc整合后测试

S7-PLCSIM Advanced V3.0虚拟PLC组态下载失败?手把手教你解决IP地址冲突问题

本文针对S7-PLCSIM Advanced V3.0组态下载失败问题,深入剖析了IP地址冲突的根本原因。通过对比博途项目PLC、虚拟网卡及本机物理网卡的IP配置,提供了清晰的排查流程与标准化解决方案,帮助用户快速修复网络可达性问题,确保虚拟PLC仿真顺利进行。

weixin_29306261的博客 193

springmvc+mybatis 构建cms内容发布系统

开发语言: java、ios、android 部署平台: linux、window jdk版本:JDK1.7以上版本 开发工具: eclipse、idea等 服务器中间件:Tomcat 6、7、Jboss 7、WebLogic 10、WebSphere 8 ...

191

让 AI 学会“慢思考”:MCP Sequential Thinking 深度部署与使用指南

摘要: MCP Sequential Thinking 是一种让AI具备"慢思考"能力的技术,通过动态调整思维路径解决复杂问题。本文详细介绍了在Windows、macOS和Linux系统下的部署方法,包括环境准备、配置文件修改等步骤。该技术通过"产生想法-评估需求-修正路径"的循环机制,显著提升AI在代码设计、数学证明等复杂任务中的表现。文章还提供了验证安装方法、使用示例和常见问题解答,帮助开发者解锁AI的深层思考能力。(149字)

weixin_43236925的博客 1907

0/1背包问题:从暴力递归到动态规划详解

题目: 有一组数量为 n 个物品,每个物品都有重量w 和价值v 给定一个背包bag,背包装的物品不能超过背包最大载重容量返回背包bag 能装下的最大价值1. 物品的重量和价值:2. 背包的容量:暴力解法的核心是递归,通过逐一决策每个物品是否放入背包,最终找到最优解。状态定义:递归逻辑:递归终止条件: 动态规划解法 递归的暴力解法有重复子问题,导致了大量的重复计算。为了解决这个问题,我们可以使用动态规划来优化。状态定义:状态转移:边界条件: 测试方法 示例解析 假设:我们希望找到在容量为

Mr.Ayao's blog 2065

Apache Shiro与Spring Security学习

参考资料: 1)Apache Shiro Apache Shiro:http://shiro.apache.org/ 在Web项目中应用 Apache Shiro:http://www.ibm.com/developerworks/cn/java/j-lo-shiro/ Apache Shiro权限框架在SpringMVC+Hibernate中的应用:http://www.thinksaas

我家猫叫奥利奥 2074

YOLOv8知识蒸馏实战:用BCKD和LD在自制数据集上分别提点1.63%和1.69%的保姆级教程

本文详细介绍了在YOLOv8模型上应用知识蒸馏技术(BCKD和LD方法)的实战教程,通过自制数据集实现性能提升1.63%和1.69%。内容涵盖环境配置、模型选择、BCKD和LD的具体实现及调参技巧,适合目标检测领域的开发者和研究者。

weixin_29082143的博客 245

Apache Shiro 快速入门教程,shiro 基础教程

第一部分 什么是Apache Shiro 1、什么是 apache shiro : Apache Shiro是一个功能强大且易于使用的Java安全框架,提供了认证,授权,加密,和会话管理 如同 Spring security 一样都是是一个权限安全框架,但是与Spring Security相比,在于他使用了和比较简洁易懂的认证和授权方式。 2、A

SwingLife的专栏 12万+

基于Qt的工业组态软件开发:图形绘制与TCP通讯实现

在数据接收时,通过 readyRead 信号触发解析函数,校验数据包完整性后提取有效数据,并更新对应图形元素的状态,例如根据温度值改变矩形的填充色,实现设备状态可视化。测试阶段,我们将软件部署到Windows工控机,连接PLC设备进行通讯测试,结果表明图形元素响应及时,TCP数据传输稳定,满足工业现场的基本需求。综上所述,基于Qt的组态软件开发,核心在于利用 QGraphicsView 框架实现图形元素的灵活绘制与管理,结合 QTcpSocket 完成工业数据的可靠交互。

谢谢大家的关注和点赞!这里只有纯纯的知识干货,没有一句废话。希望能实实在在帮到大家~要是觉得有用,别忘了给我点支持哟,你 272

SO_KEEPALIVE、TCP_KEEPIDLE、TCP_KEEPINTVL、保活包

是一个套接字选项,用于设置是否启用 keepalive 机制。在这段代码中没有涉及到选项的设置。当被设置为非零值时,表示启用 keepalive 机制。keepalive 是一种用于检测连接是否仍然有效的机制。通过定期发送一些特定的探测数据,可以检测到网络连接的异常中断或对端应用程序的崩溃退出。为了避免以上情况,可以启用 keepalive 机制,即使在无数据传输的情况下也定期发送探测数据。如果在一定时间内没有收到对端的响应,就认为连接已经失效,并进行相应的处理。要启用选项,需要使用函数。其中,fd。

m0_46376834的博客 4813

maven springmvc hibernate shiro 集成

最近项目需要进行高要求的Web权限管理,在比较Spring security和Shiro之后由于Shiro更大的灵活度和更强的配置性选择了Shiro。 不过官方的文档写的对于集成spring不太清楚,尤其是Realm怎样实现。 因此,在查阅一系列资料之后,将目前集成的步骤总结出来。 特别推荐博文:http://www.cnblogs.com/xql4j/archive/2013/03/30/

jokes000的专栏 8399

Dify 第 2 篇 Dify 插件离线安装

Dify是一个支持插件扩展的AI平台,其插件市场提供5种类型插件(模型、工具、Agent策略、扩展、插件包)。由于默认pip安装速度慢,可通过dify-plugin-repackaging工具将插件转换为离线包(使用阿里云镜像加速)。该工具提供两种方式:1)自备Python环境执行脚本;2)使用Docker环境(推荐)。脚本支持从Dify市场或GitHub下载插件,并重新打包为含依赖的离线包,便于通过"本地插件"方式快速安装。

甘蓝的专栏 1258

在Spring MVC中使用Apache Shiro安全框架

我们在这里将对一个集成了Spring MVC+Hibernate+Apache Shiro的项目进行了一个简单说明。这个项目将展示如何在Spring MVC 中使用Apache Shiro来构建我们的安全框架。 阅读文章前,您需要做以下准备: Maven 3环境 Mysql-5.6+ JDK1.7+ git环境 git.oschina.net帐号 Apache Tomcat 7+ ...

javarrr的博客 450

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

NTscan扫描工具

ntscan是一个扫描器,可以扫描没有密码和弱密码的共享,先到配置文件中填写猜测的用户名和密码,扫描过程中右侧出现的是扫描日志。

将 Shiro 作为应用的权限基础 五:SpringMVC+Apache Shiro+JPA(hibernate)整合配置

配置web.xml,applicationContext.xml, spring-mvc.xml, applicationContext-shiro.xml,而且都有详细的说明。   Web.xml是web项目最基本的配置文件,看这个配置,可以快速知道web项目使用什么框架,它就像一个面板,切入我们想用的插件。 applicationContext.xml 是spring的基本配置,主要

时光在路上 1万+

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

springMVC 整合shiro

本人小白一枚,初次接触shiro,花了两天时间搞了一下可算能用了,当然虽然spring security功能更强大,但是太繁琐了,不容易入门,并且shiro功能感觉也完全够用了;各位童鞋可以参考别人的文章:http://jinnianshilongnian.iteye.com/blog/2049092 1、web.xml中增加spring-shiro.xml配置 contextC

cuiyuanjie的博客 1820

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

SpringMVC+Apache Shiro+JPA(hibernate)案例教学(二)基于SpringMVC+Shiro的用户登录权限验证...

序:   在上一篇中,咱们已经对于项目已经做了基本的配置,这一篇文章开始学习Shiro如何对登录进行验证。 教学: 一、Shiro配置的简要说明。   有心人可能注意到了,在上一章的applicationContext.xml配置文件中,包含以下配置。 <!-- 項目自定义的Realm --> <bean id="shiroDbReal...

diaojie7665的博客 163

【Shiro】SpringMVC+Shiro权限管理

1.权限的简单描述 2.实例表结构及内容及POJO 3.Shiro-pom.xml 4.Shiro-web.xml 5.Shiro-MyShiro-权限认证,登录认证层 6.Shiro-applicationContext-shiro.xml 7.HomeController三个JSP文件    什么是权限呢?举个简单的例子: 我有一个论坛,注册的用户分为normal

每一名出色的架构师,必定是一位优秀程序员 2355

将 Shiro 作为应用的权限基础 六:源码以及下载地址

提供的源码包括 SpringMVC+Apache Shiro的整合 SpringMVC+Apache Shiro+JPA(hibernate)整合配置

时光在路上 4985

springmvc 功能 登出_Spring MVC 中集成 Apache Shiro 安全框架

来源:holynull,www.gitbook.com/book/holynull/-spring-mvc-apache-shiro-/details我们在这里将对一个集成了Spring MVC+Hibernate+Apache Shiro的项目进行了一个简单说明。这个项目将展示如何在Spring MVC 中使用Apache Shiro来构建我们的安全框架。阅读文章前,您需要做以下准备:Maven...

weixin_39781930的博客 148

shiro权限框架

Shiro与SpringMVC整合 第一部分 什么是Apache Shiro 1、什么是 apache shiro : Apache Shiro是一个功能强大且易于使用的Java安全框架,提供了认证,授权,加密,和会话管理 如同 Spring security 一样都是是一个权限安全框架,但是与Spring Security相比,

itbigboy的博客 653
上一篇: 细数JDK里的设计模式
下一篇: 分布式缓存系统Memcached简介与实践
pingdouble
博客等级 码龄15年 325粉丝 63原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值