Reply To: Rewrite + Apache Shiro

Splash Forums Rewrite Users Rewrite + Apache Shiro Reply To: Rewrite + Apache Shiro

#23798

zozan
Participant

Sure.
shiro.ini`[main]
authc.loginUrl = /Login.xhtml
user.loginUrl = /Login.xhtml
authc.successUrl = ../admin/index.xhtml

[users]
admin = password

[urls]
/Login.xhtml = authc
/admin/** = authc`

CustomRewriteConfigurationProvider:

public Configuration getConfiguration(final ServletContext context)
   {
     return ConfigurationBuilder.begin()                 
    // initial redirect to /Home
     .addRule()
     .when(Path.matches("/"))
     .perform(Redirect.temporary(context.getContextPath() + "/Home"))  
             
     .addRule(Join.path("/{Home}").to("/{Home}.xhtml")             
         .withInboundCorrection())
         .when(DispatchType.isRequest())
         .where("Home").matches("[^/.]+");
}
  • This reply was modified 8 years, 8 months ago by  zozan.
  • This reply was modified 8 years, 8 months ago by  Lincoln Baxter III.