Nov 27th, 2008, 12:38 PM
Login form on multiple pages
I'd like to have a login form available on every page on the web site. I'm having troubles when configuring the SimpleFormController because formview & successview are not constant (I think so).
The first issue was a Exception raised when the form was displayed because the 'command' object was no initialized by the formBackingObject method and the form binding fails.
I resigned for direct data binding using a standard HTML form but when I try to dynamically assign the formview/successview in the controller logic, it's not really consistant and I get some errors.
I can't figure how achieve this facility and I feel it's a quite common subject that many site offer.
Any idea ?
Nov 28th, 2008, 09:20 AM
I finally sorted this out by setting the sessionForm attribute to false to force to go by the formBackingObject method where I initialize the formview to the current page.
Dec 2nd, 2008, 02:20 AM
Just a question because I will be in a similar situation soon How did you "include" your login from on every page of your application? Are you using Tiles, JFS, Freemarker, "pure" JSPs, ...?
I imagine I could have a "link" to let's say "login.html" in a "template" that is used on every page and map "/login.html" to my login controller?
Something along these lines?
Dec 8th, 2008, 02:11 PM
The login form is basically included as a jsp fragment in the main navigation bar. I don't know jsf but I assume it's possible. My little experience with Tiles, Freemarker or Velolicy just make me sure it's easy to do with these technologies. As far as I remember , Tiles would be the best choice as there's a 'Layout' approach where you could include your login form and present it on every pages but this technologiy is sometimes overkill for simple sites.
Hope this helps,