Announcement Announcement Module
Collapse
No announcement yet.
Spring security + ICEfaces redirect to css after login Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring security + ICEfaces redirect to css after login

    Hi!

    I'm trying to configure Spring Security + ICEfaces, I've got it almost working but there's one thing that keeps happening that I don't know how to solve. The first time I run the application, when a user logs in correctly instead of being redirected to default-target-url it is redirected to a css (which happens to be the first css in the page /resources/stylesheet.css).

    I've read it may have something to do whith the "<ice: />" tags, but I'm no sure if that's true or how to solve this problem.

    The files I'm using are:

    applicationContext-security.xml

    Code:
    <security:http
    		auto-config="true"
    		access-denied-page="/index.jsp">
                
            <security:intercept-url pattern="/block/**" filters="none" />
            <security:intercept-url pattern="/xmlhttp/**" filters="none"/>
    
            <security:intercept-url
    			pattern="/index.jsp"
    			filters="none" />
            <security:intercept-url
    			pattern="/home/*"
    			access="ROLE_USER" />
            <security:intercept-url
    			pattern="/admin/*"
    			access="ROLE_ADMIN" />
            <security:intercept-url
    			pattern="/**"
    			access="ROLE_USER" />
    		<security:form-login
    			login-processing-url="/j_spring_security_check"
    			login-page="/index.jsp"
    			default-target-url="/home/indexUsuarios.jsp"
    			authentication-failure-url="/index.jsp" />
    		<security:logout
    			logout-success-url="/index.jsp" />
    	</security:http>
    and the indexUsuarios.jsp is:
    Code:
    <jsp:root version="2.1" xmlns:f="java.sun.com/jsf/core" xmlns:h="java.sun.com/jsf/html" xmlns:ice="icesoft.com/icefaces/component" xmlns:jsp="java.sun.com/JSP/Page">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
        <f:view>
            <html id="outputHtml1">
                <head id="outputHead1">
                    <ice:outputStyle href="./resources/stylesheet.css" id="outputStyle1"/>
                    <ice:outputStyle href="./xmlhttp/css/xp/xp.css" id="outputStyle2"/>                
                </head>
                <body id="outputBody1" style="-rave-layout: grid">
                    <ice:form id="form1">
                        <ice:commandButton actionListener="#{LoginBean.logout}" id="button1" style="position: absolute; left: 432px; top: 168px" value="logout"/>
                        <ice:commandLink id="commandLink1" action="registroUsuarios" style="position: absolute; left: 192px; top: 72px" value="Registro Usuarios"/>
                    </ice:form>
                </body>
            </html>
        </f:view>
    </jsp:root>
    Don't pay attention to the xmlns tag in the jsp as I had to remove all the links (it's my first post).

    So, anyone has had this kind of problem or knows how to solve it?

    Tanks in advance!

  • #2
    Ok, just after posting this I found that if I specify in <security:form-login always-use-default-target="true" /> everything works as expected.

    Comment

    Working...
    X