This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes Spring 2.5 | Quick Singn - In page on the website header. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring 2.5 | Quick Singn - In page on the website header." Watch "Spring 2.5 | Quick Singn - In page on the website header." New topic

Spring 2.5 | Quick Singn - In page on the website header.

Ishu Saxena

Joined: Jun 24, 2008
Posts: 25
Dear Ranchers,

Just need some assistance from you guys with handling login functionality on our eStore. Here's what is required:

1) We already have a sign in module up and running as a separate view. However, we need to provide a ;Sign In' link on the header of the store (available on all pages), clicking on this link will open a small window which will ask of user credentials.
2) I plan on having a hidden <div> block in the header element that contains the signin form. We'll enable this <div> on the 'Sign In' link click.

Here's what I have tried so far:

1) The link for 'Sign In' on the header maps to a page called 'sign-in.ep., that is handled by a controller. In this controller, in the formBackingObject() method, I return the formbean. Something similar to the following:

The Mapping File:

The Controller:

2) I've created a separate file that renders the Sign In form for now. Here's teh controller definition:

3) Now, the problem here is that I need to access the formbean returned from the controller in the header and NOT in the file 'quickSignIn'. Wondering if there is a way I can achieve this getting the formbean in teh header element so that the Login form can be seen across all pages (via the header)?

I'd appreciate any inputs on this.


--<br />SCJP 5.0
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

Are you using Spring Security?

Also, your login is in a different view as of now. Why not take that <form> that is in the other view and just paste it in your website header? It should be the same functionality. Or am I missing something?


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ishu Saxena

Joined: Jun 24, 2008
Posts: 25
Thanks for your repky Mark. Yes, I am using spring security.
I tried copy pasting my form tags in the header, which is included in every page.
Now, what happens is that when I open the home page, the signin controller hanot been called yet and my header element
expects a valid form bean to bind values to., which apparently is not there.

Moreover, i was wondering what should be defined as the 'nextview'
in my signin controller since I want the user to stay on the same page on the signin link click
and open the signin form in the hidden div tags insde my header element.


I agree. Here's the link:
subject: Spring 2.5 | Quick Singn - In page on the website header.
Similar Threads
Changed values aren't set on the backing object.
Validation framework not working for login screen
DispatchAction No action instance for path ...
Spring exception Neither BindingResult nor plain target object for bean name 'name' a
Problem in injecting interface