Displaying the Login Page for Non Authenticated User?

Hi,

I have an issue in my project that if i try to invoke a URL related to create user directly without login in from the login page it should forward the control the login. jsp ? So only authenticated user can invoke those pages by login in. Pls. do provide a sample example on this and how to proceed with it. It is quite urgent.

Thanks,

JavaCrazyLover

[379 byte] By [AnanthJavaa] at [2007-11-27 3:11:55]
# 1
make a check wether a session has been set at the user that contains his login informationif not, redirect him to login.jsp, otherwise show
radicjesa at 2007-7-12 8:14:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Implement a Filter which checks if the user is logged in. If not, then redirect to the loginpage.I'd written something about this a short while back: http://forum.java.sun.com/thread.jspa?threadID=5166655
BalusCa at 2007-7-12 8:14:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
On login you can set a session variable.Then on each page check for the session variable.if the session variable is not found(expired),redirect to the login page.regards,vysh
vysha at 2007-7-12 8:14:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Indeed. You can do this easily using a Filter.
BalusCa at 2007-7-12 8:14:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
What if you have different parts on a page you want to show to different users though ?Like an admin menu on the main page, you can't do that with a filter, has to be done in the view afaik
radicjesa at 2007-7-12 8:14:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
Then indeed handle it in the controller and the view. JSF knows the 'rendered' attribute which might be useful in this case. In JSP use the choose/if tags.But that's not the subject here in this topic ;)
BalusCa at 2007-7-12 8:14:24 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...