Basic Security in JSF

Viewed 48129

I would like to see a simple Login Application, not as simple as this though.

What I would like to achieve is an understanding on how JSF works, I've developed a lot of ASP.NET where you have the code behind and where you can just check if a session was created upon Login.

A similar solution in JSF would be great.

This is basically what I want to achieve:

  • Login page
  • IF OK
    • Create session and return "success"
  • IF FAIL
    • return "failure"

(The "success" and failure are mapped to faces-config.xml)

At the success-page I want to be Certain that the user is logged in, so one should Not be able to navigate to "success.jspx" if you have not got the correct session.

4 Answers

The best way to do it would be to use container managed security.

Here is a tutorial on how to achieve that with glassfish and jsf.

Related