Announcement Announcement Module
Collapse
No announcement yet.
access denied handler does not work for controller Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • access denied handler does not work for controller

    I have a controller method annotated as this:
    Code:
    	@RequestMapping(value={"/failed403"},method=RequestMethod.GET)
    	public String render403Page(HttpServletRequest request,HttpSession session,Model model)
    	{
    
    		return "denied";
    	}
    Here is my security config:
    Code:
       <http auto-config="true" use-expressions="true" 
        	create-session="ifRequired" access-denied-page="/failed403" >
    ...
    </http>
    here is the mvc config:

    Code:
     ...
        <mvc:view-controller path="/login"/>
        <mvc:view-controller path="/index"/>
    	<mvc:view-controller path="/uncaughtException"/>
    	<mvc:view-controller path="/resourceNotFound"/>
    	<mvc:view-controller path="/dataAccessFailure"/>
    
    	<!-- Resolves logical view names returned by Controllers to Tiles; a view
    		 name to resolve is treated as the name of a tiles definition -->
    	<bean class="org.springframework.js.ajax.AjaxUrlBasedViewResolver" id="tilesViewResolver">
    		<property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/>
    	</bean>
    
    	<!-- Configures the Tiles layout system -->
    	<bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer" id="tilesConfigurer">
    		<property name="definitions">
    			<list>
    				<value>/WEB-INF/layouts/layouts.xml</value>
    				<!-- Scan views directory for Tiles configurations -->
    				<value>/WEB-INF/views/**/views.xml</value>
    			</list>
    		</property>
    	</bean>
    here is the tiles config:
    Code:
    <tiles-definitions>
    ...
    <definition extends="default" name="denied">
            <put-attribute name="body" value="/WEB-INF/views/denied.jspx"/>
        </definition>
    </tiles-definitions>
    Here is the URL rewrite xml.
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN" "http://tuckey.org/res/dtds/urlrewrite3.0.dtd">
    
    <urlrewrite default-match-type="wildcard">
    	<rule>
    		<from>/resources/**</from>
    		<to last="true">/resources/$1</to>
    	</rule>
    	<rule>
    		<from>/static/WEB-INF/**</from>
    		<set type="status">403</set>
    		<to last="true">/static/WEB-INF/$1</to>
    	</rule>
    	<rule>
    		<from>/static/**</from>
    		<to last="true">/$1</to>
    	</rule>
    	<rule>
    		<from>/</from>
    		<to last="true">/app/index</to>		
    	</rule>
    	
    	
    	<rule>
    		<from>/app/**</from>
    		<to last="true">/app/$1</to>
    	</rule>
    	<rule>
    		<from>/**</from>
    		<to>/app/$1</to>
    	</rule>
    	<outbound-rule>
    		<from>/app/**</from>
    		<to>/$1</to>
    	</outbound-rule>	
    </urlrewrite>
    I just want to be able to make sure that my access denied page extends my tiles template. How do I configure that, If I give the access-denied-page anything other than a path to my jspx file, it fails with this exception:

    Requested Resource Not Found

    Sorry, we did not find the resource you were looking for.
Working...
X