Announcement Announcement Module
No announcement yet.
Using a Tiles definition for the Spring Security login page Page Title Module
Move Remove Collapse
This topic is closed
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using a Tiles definition for the Spring Security login page

    Is there anything special that needs to be done to use a Tiles defintion for the Spring Security login page? I can see in the new sample app bundled with WF2 that it seems simple enough:
    <security:form-login login-page="/spring/login" login-processing-url="/spring/loginProcess" default-target-url="/spring/hotels/index" authentication-failure-url="/spring/login?login_error=1" />
    There is a Tiles definition for login and I'm assuming the DispatcherServler finds this page through the view mappings declaration in the mvc configuration file:

    	<bean id="viewMappings" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="defaultHandler">
    			<!-- Selects view names to render based on the request URI: e.g. the "/intro" URL would map to the view named "intro" -->	
    			<bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController" />
    		<property name="order" value="2"/>
    I have also set up a viewmappings bean and have added a breakpoint to it but it doesn't seem to get there when accessing a protected URL (I sply see login not found).

    Any assistance or tips would be greatly appreciated : )

  • #2
    Has there been a resolution to your question?

    Hi mikeycmccarthy. I've tried a few things. I tried using a pass-through controller so instead of
    <form-login login-page="/login"/>
    (I have a tiles definition named "login"), I just used
    <form-login login-page="/login.htm" />
    where login.htm is mapped to a controller which then just forwards it to "login". In my servlet.xml definition, I added
    <bean id="tilesViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
         <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
         <property name="order" value="1"></property>
    It doesn't behave correctly especially if I enter invalid login information. Does anybody have any decent examples on how to use tiles for the login page using form-login?