admin 管理员组

文章数量: 887021


2024年2月7日发(作者:目前流行的css版本)

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

配置,, ,,而且都有详细的说明。

是web项目最基本的配置文件,看这个配置,可以快速知道web项目使用什么框架,它就像一个面板,切入我们想用的插件。

是spring的基本配置,主要配置数据源、JPA实体管理器工厂、事务;

是SpringMVC的配置;

是shiro的配置,主要配置securityManager、shiroFilter;

pectorCleanupListener

tLoaderListener

characterEncodingFilter

terEncodingFilter

encoding

UTF-8

forceEncoding

true

characterEncodingFilter

/*

hibernateFilter

t

.OpenEntityManagerInViewFilter

hibernateFilter

/*

shiroFilter

tingFilterProxy

targetFilterLifecycle

true

shiroFilter

/*

dispatcherServlet

cherServlet

contextConfigLocation

classpath:

-->

1

dispatcherServlet

/

-->

xmlns:xsi="/2001/XMLSchema-instance"

xmlns:aop="/schema/aop"

xmlns:tx="/schema/tx"

xmlns:context="/schema/context"

xmlns:p="/schema/p"

xmlns:cache="/schema/cache"

xmlns:jaxws="/jaxws"

xsi:schemaLocation="

/schema/beans

/schema/beans/

/schema/tx

/schema/tx/

/schema/aop

/schema/aop/

/schema/context

/schema/context/

/schema/cache

/schema/cache/

/jaxws

/schemas/ ">

type="annotation"

expression="ller"/>

location="classpath:ties" />

class="DataSource"

destroy-method="close">

"ontainerEntityManagerFactoryBean">

ref="hibernateJpaVendorAdapter" />

thread

update

false

false

edNamingStrategy

"ateJpaVendorAdapter">

value="${t}"/>

"nsactionManager">

ref="entityManagerFactory" />

xmlns:mvc="/schema/mvc"

xmlns:xsi="/2001/XMLSchema-instance"

xmlns:context="/schema/context"

xsi:schemaLocation="

/schema/beans

/schema/beans/

/schema/context

/schema/context/

/schema/mvc

/schema/mvc/">

"alResourceViewResolver">

"MappingExceptionResolver">

"orizedException">

/system/error

xmlns:xsi="/2001/XMLSchema-instance"

xsi:schemaLocation="/schema/beansht

default-lazy-init="true">

Shiro安全配置

class="tWebSecurityManager">

class="eManager">

value="classpath:" />

class="bRealm"

depends-on="baseService">

class="ilterFactoryBean">

/login = anon

/validateCode = anon

/** = authc

class="cleBeanPostProcessor" />

"tAdvisorAutoProxyCreator"

depends-on="lifecycleBeanPostProcessor">

"izationAttributeSourceAdvisor">


本文标签: 配置 使用 属性 配置文件 默认