webtier@glassfish.java.net

Re: Login Scheme

From: <webtier_at_javadesktop.org>
Date: Fri, 26 Feb 2010 19:59:57 PST

Hey Cam,

I've been playing with login/registration panels as a way of catching up on the basics of JSF 2.0. I have a prototype of an application written in PHP, but it needs really needs to be rewritten in Java because of various issues. Since I was using the PHP "tank-auth" user authentication system, I thought I might as well port it to Java (or at least use it as a rough guideline away). It tries to cover all the bases -- registration, login, captcha, email registration and notification, and so on.

I have settled for a mixture of standard JSF 2.0 component pages inside a template, using the JQuery validation plugin for all the client-side validation (which was ridiculously easy to do) and then just using the standard h:commandButton submits to the server to validate the userid and password etc (using JPA). It's nothing clever, but it seems to be working fine now that I am getting the hang of JSF 2.0. a little.

I agree that there isn't really a major need for Ajax on a login panel. If you are going to turn your web application into a client-side application, then you would probably be better off using Google GWT anyway.

The user interface you should use depends on how long the users have to wait before they see the next screen. If it's only a couple of seconds, then the basic approach is fine, but if it's much longer than that (Google Mail is downloading a whole application when loading up so it can take a while) then you should provide some feedback to prevent your user from worrying that there is something wrong and clicking refresh. I would think that PrimeFaces or RichFaces or some other component library would provide some sort of progress bar you need without having to roll your own.

One place I see Ajax used a lot is when your checking a new username at registration time to see if it has already been taken. I am just working on the registration form at the moment, so I might have a go with Ajaxifying that field, mostly to learn how to do it.
[Message sent by forum member 'tacitust' (tacitus_at_yahoo.com)]

http://forums.java.net/jive/thread.jspa?messageID=389046