aspose file tools
The moose likes Spring and the fly likes Facelets + Spring Security Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "Facelets + Spring Security" Watch "Facelets + Spring Security" New topic
Author

Facelets + Spring Security

Adolfo Eloy
Ranch Hand

Joined: Mar 21, 2009
Posts: 142

Hi.

I'm trying to use Spring Security 2.0 with a Facelets + JSF 1.2 web application.
I've tried configuring Spring Security with only JSF and it's working fine.
But when I'm using Facelets the problems come.

This my web directory structure:
...
WebContent
---- content/
-------- area1/page1.xhtml
-------- area2/page2.xhtml
----- menu.xhtml

So I've configured my applicationContext-security.xml as follows:


My menu.xhtml have a commandLink with an action named page1 which is mapped in my faces-config.xml navigation rules to the correct page which is: /content/area1/page1.xhtml

When I start my application and try to access the page1 link, this page is rendered without calling the spring security login form.
So when I select another item from menu, the login form is rendered in a late way.

It seems to be using an old url.

I'd like to solve this and I've already searched over internet without success.
Any help will be appreciated.

Thanks.


Adolfo Eloy
Software Developer
OCPJP 6
Adolfo Eloy
Ranch Hand

Joined: Mar 21, 2009
Posts: 142

The problem was exactly with facelets! The problem was happening with JSF by itself.
Reading a Brazilian post at google groups someone give-me help where he was saying to use redirect instead of forward in my faces-config.xml file.

Indeed that solution worked for me.

I'll study more about it to give more conceptual knowledge and maybe I could write something about it to help anybody who can have the same problem.

Even though this is a problem that is more related with JSF forum, follows an example of using the redirect in faces config.

 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Facelets + Spring Security
 
Similar Threads
Integrating Spring & JDBC into JSF2 login page
spring security 3.1 login not working.
RichFaces + Spring Security -- Problem Load RichFaces
Login Form with Spring Security + JSF2.0 + Facelets + RichFaces
SpringSecurity-config.xml doesn´t find http tag