Freemarker tags for Apache Shiro, mirroring the JSP tags that ship with Shiro
Java
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist Created Freemarker tags for Apache Shiro, these mirror the JSP tags Jul 7, 2011
src/main/java/com/jagregory/shiro/freemarker
.gitignore
README.md Created Freemarker tags for Apache Shiro, these mirror the JSP tags Jul 7, 2011
pom.xml

README.md

Apache Shiro tags for Freemarker

Apache Shiro comes with some handy JSP tags for doing things like only showing content for anonymous users, logged in users, etc... I'm using Freemarker and didn't want to take a dependency on JSP just for Shiro, so I rewrote the tags for Freemarker.

Install

Either download the dist/shiro-freemarker-tags-0.1-SNAPSHOT.jar or take all the java files and stick them in your project. Simple.

If there's enough demand, I could put this up on Maven.

Usage

Declare a shared variable called "shiro", and assign it to an instance of the ShiroTags class.

cfg.setSharedVariable("shiro", new ShiroTags());

You should then be able to use the tags in your Freemarker templates.

<@shiro.guest>Hello guest!</@shiro.guest>

License

Do what you want with it, just don't blame me if it breaks anything.