在FreeMarker框架中使用Shiro的Tag标签
来源:互联网 发布:杨辉三角形c语言十行 编辑:程序博客网 时间:2024/05/16 13:51
可以先了解下shiro
第一步:下载shiro-freemarker-tags GitHub地址:https://github.com/jagregory/shiro-freemarker-tags
可以先看一下他的说明文档,有一个初步的了解。
第二步:Spring MVC配置
自定义一个ShiroTagFreeMarkerConfigurer继承Spring本身提供的FreeMarkerConfigurer,目的是在FreeMarker的Configuration中添加shiro的配置
public class ShiroTagFreeMarkerConfigurer extends FreeMarkerConfigurer { @Override public void afterPropertiesSet() throws IOException, TemplateException { super.afterPropertiesSet(); this.getConfiguration().setSharedVariable("shiro", new ShiroTags()); } }
第三步:xml文件配置
<bean id="freemarkerConfig" class="com.xxx.core.shiro.freemarker.ShiroFreeMarkerConfigurer"><property name="templateLoaderPath" value="/WEB-INF"/><property name="freemarkerVariables"><map></map></property><property name="freemarkerSettings"><props><prop key="template_update_delay">0</prop><prop key="defaultEncoding">UTF-8</prop><prop key="url_escaping_charset">UTF-8</prop><prop key="locale">zh_CN</prop><prop key="boolean_format">true,false</prop><prop key="datetime_format">yyyy-MM-dd HH:mm:ss</prop><prop key="date_format">yyyy-MM-dd</prop><prop key="time_format">HH:mm:ss</prop><prop key="number_format">0.######</prop><prop key="whitespace_stripping">true</prop><prop key="auto_import">/ftl/spring.ftl as s</prop></props></property></bean>
<@shiro.guest>Hello guest!</@shiro.guest>
0 0
- 在FreeMarker框架中使用Shiro的Tag标签
- 在FreeMarker框架中使用Shiro的Tag标签
- freemarker中使用shiro标签
- freemarker中使用shiro标签
- freemarker中使用shiro标签
- Apache Shiro 整合Spring 进行权限验证 以及在Freemarker中使用shiro标签
- Apache Shiro 整合Spring 进行权限验证 以及在Freemarker中使用shiro标签
- Apache Shiro 整合Spring 进行权限验证 以及在Freemarker中使用shiro标签
- Apache Shiro 整合Spring 进行权限验证 以及在Freemarker中使用shiro标签
- freemarker 在FreeMarker中使用JSP标签
- 添加freemarker的shiro标签
- 在Freemarker中使用struts2标签
- 在freemarker中使用struts2标签库
- 在freemarker中使用jsp标签 Using FreeMarker with servlets
- 在freemarker中使用jsp标签 Using FreeMarker with servlets
- (5)Shiro的tag标签
- Idea中使用github的标签(tag)
- 自定义Shiro标签Tag
- c/c++开发 总结
- IE下判断IE版本的语句...[if lte IE 8]……[endif]
- 奇怪了,阎真的书
- [JAVA考试系统]项目总结
- java与javac版本不一致问题
- 在FreeMarker框架中使用Shiro的Tag标签
- 什么是Smartphone data slinging?
- js资料总结
- Java struts 框架编程(Struts1)
- UVALive - 3695 Distant Galaxy 暴力
- 【java编程】Map集合之TreeMap字符串中字符出现次数
- Jersey框架三:Jersey对HTTPS的支持
- python序列映射操作
- 存储过程输出参数、返回值、返回表及C#调用