課程
/后端開發(fā)
/Java
/Shiro安全框架入門
web.xml文件有嗎???
2019-01-27
源自:Shiro安全框架入門 4-1
正在回答
<?xml?version="1.0"?encoding="UTF-8"?> <web-app?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ?????????xmlns="http://java.sun.com/xml/ns/javaee" ?????????xsi:schemaLocation="http://java.sun.com/xml/ns/javaee?http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" ?????????version="3.0"> ??<display-name>Archetype?Created?Web?Application</display-name> ????<!--?Spring和mybatis的配置文件?--> ????<context-param> ????????<param-name>contextConfigLocation</param-name> ????????<param-value>classpath:spring/spring.xml</param-value> ????</context-param> ????<!--?將shiro交給spring容器管理?--> ????<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> ????<!--?編碼過濾器?--> ????<filter> ????????<filter-name>encodingFilter</filter-name> ????????<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> ????????<async-supported>true</async-supported> ????????<init-param> ????????????<param-name>encoding</param-name> ????????????<param-value>UTF-8</param-value> ????????</init-param> ????</filter> ????<filter-mapping> ????????<filter-name>encodingFilter</filter-name> ????????<url-pattern>/</url-pattern> ????</filter-mapping> ????<!--?Spring監(jiān)聽器?--> ????<listener> ????????<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> ????</listener> ????<!--?防止Spring內(nèi)存溢出監(jiān)聽器?--> ????<listener> ????????<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class> ????</listener> ????<!--?Spring?MVC?servlet?--> ????<servlet> ????????<servlet-name>SpringMVC</servlet-name> ????????<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> ????????<init-param> ????????????<param-name>contextConfigLocation</param-name> ????????????<param-value>classpath:spring/spring-mvc.xml</param-value> ????????</init-param> ????????<load-on-startup>1</load-on-startup> ????????<async-supported>true</async-supported> ????</servlet> ????<servlet-mapping> ????????<servlet-name>SpringMVC</servlet-name> ????????<url-pattern>/</url-pattern> ????</servlet-mapping> ????<welcome-file-list> ????????<welcome-file>login.html</welcome-file> ????</welcome-file-list> </web-app>
<?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"> ????<!--?配置注解掃描?--> ????<context:component-scan?base-package="com.shirostudy.service"?/> ????<bean?id="shiroFilter"?class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> ????????<property?name="securityManager"?ref="securityManager"/> ????????<property?name="loginUrl"?value="login.html"?/> ????????<property?name="unauthorizedUrl"?value="403.html"?/> ????????<property?name="filterChainDefinitions"?> ????????????<value> ????????????????/login.html?=?anon ????????????????/*?=authc ????????????</value> ????????</property> ????</bean> ????<!--?創(chuàng)建SecurityManager環(huán)境?--> ????<bean?id="securityManager"?class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"> ????????<property?name="realm"?ref="realm"/> ????</bean> ????<!--?加密鹽?--> ????<bean?id="credentialsMatcher"?class="org.apache.shiro.authc.credential.HashedCredentialsMatcher"> ????????<property?name="hashAlgorithmName"?value="md5"?/> ????????<property?name="hashIterations"?value="1"/> ????</bean> ????<!--?創(chuàng)建自定義Realm?--> ????<bean?id="realm"?class="shiro.AdminRealm"> ????????<property?name="credentialsMatcher"?ref="credentialsMatcher"/> ????</bean> </beans>
黑色的白兔
舉報
從零入門Shiro安全框架
1 回答idea如何自動生成web.xml文件
2 回答web.xml
3 回答web.xml
4 回答請問idea新建web.xml文件時,怎么自動生成xml代碼
3 回答web.xml來一個好嗎?秋梨膏!!!!!
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學習伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2019-02-28
2019-02-01