This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Facelets + Spring Security

 
Adolfo Eloy
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Ranch Hand
Posts: 146
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic