How to get Login page while submitting a data form

View: New views
9 Messages — Rating Filter:   Alert me  

How to get Login page while submitting a data form

by Sanjaya Kumar Patel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi All,

My requirement is this:

1. User fills a form and submits.
2. If he has not logged in, login form comes up.
3. after logging in, the data automatically gets submitted and next page comes.

I am new to struts and unable to figure out the natural solution, even after a lot of googling. As I understand step 2 should be easy using interceptor, but how to get step 3 work?

I am using struts 2.1.8.

thanks,
Sanjay
http://www.sanjaypatel.name

     
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop

Re: How to get Login page while submitting a data form

by Paweł Wielgus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Sanjay,
when intercepting action for the first time (no logged user),
You can save submited data along with request uri and put it into
session/database
then after login (inside login action), check if these informations
are present in sesion/database
and forward to desired action with all the params that You have
collected before login.

Best greetings,
Paweł Wielgus.


2009/11/13 Sanjaya Kumar Patel <skpatel20@...>:

>
> Hi All,
>
> My requirement is this:
>
> 1. User fills a form and submits.
> 2. If he has not logged in, login form comes up.
> 3. after logging in, the data automatically gets submitted and next page comes.
>
> I am new to struts and unable to figure out the natural solution, even after a lot of googling. As I understand step 2 should be easy using interceptor, but how to get step 3 work?
>
> I am using struts 2.1.8.
>
> thanks,
> Sanjay
> http://www.sanjaypatel.name
>
>
> _________________________________________________________________
> New Windows 7: Find the right PC for you. Learn more.
> http://windows.microsoft.com/shop

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


RE: How to get Login page while submitting a data form

by Sanjaya Kumar Patel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi Pawel, Thanks for the insight. I would give a try.


Being a common scenario, is there any existing work already present for
this, so that I don't have to reinvent the wheel? I guess there should
already be some established library / code sample which people follow.
What do people normally do?

> when intercepting action for the first time (no logged user),
> You can save submited data along with request uri and put it into
> session/database
> then after login (inside login action), check if these informations
> are present in sesion/database
> and forward to desired action with all the params that You have
> collected before login.


> > My requirement is this:
> >
> > 1. User fills a form and submits.
> > 2. If he has not logged in, login form comes up.
> > 3. after logging in, the data automatically gets submitted and next page comes.
> >
> > I am new to struts and unable to figure out the natural solution, even after a lot of googling. As I understand step 2 should be easy using interceptor, but how to get step 3 work?
> >
> > I am using struts 2.1.8.

     
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop

RE: How to get Login page while submitting a data form

by Kawczynski, David :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

If a <form> requires authentication, don't render it until the
user is logged in.

If you are worried about the user's session timing out before
the form is submitted, implement some sort of javascript timer
that (after a period equal to a session timeout), pops up a
modal login form.  Successfully submitting the login form
Resets the timer, makes the login form disappear, and
the user is free to submit their form.




> -----Original Message-----
> From: Sanjaya Kumar Patel [mailto:skpatel20@...]
> Sent: Friday, November 13, 2009 3:48 PM
> To: Struts User Group
> Subject: RE: How to get Login page while submitting a data form
>
>
> Hi Pawel, Thanks for the insight. I would give a try.
>
>
> Being a common scenario, is there any existing work already
> present for
> this, so that I don't have to reinvent the wheel? I guess there should
> already be some established library / code sample which people follow.
> What do people normally do?
>
> > when intercepting action for the first time (no logged user),
> > You can save submited data along with request uri and put it into
> > session/database
> > then after login (inside login action), check if these informations
> > are present in sesion/database
> > and forward to desired action with all the params that You have
> > collected before login.
>
>
> > > My requirement is this:
> > >
> > > 1. User fills a form and submits.
> > > 2. If he has not logged in, login form comes up.
> > > 3. after logging in, the data automatically gets
> submitted and next page comes.
> > >
> > > I am new to struts and unable to figure out the natural
> solution, even after a lot of googling. As I understand step
> 2 should be easy using interceptor, but how to get step 3 work?
> > >
> > > I am using struts 2.1.8.
>
>      
> _________________________________________________________________
> New Windows 7: Find the right PC for you. Learn more.
> http://windows.microsoft.com/shop
>
Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


RE: How to get Login page while submitting a data form

by Sanjaya Kumar Patel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> If a <form> requires authentication, don't render it until the
> user is logged in.
>
> If you are worried about the user's session timing out before
> the form is submitted, implement some sort of javascript timer
> that (after a period equal to a session timeout), pops up a
> modal login form.  Successfully submitting the login form
> Resets the timer, makes the login form disappear, and
> the user is free to submit their form.

Nice idea!



Curious to know what is the common practice. Would like to hear if people are using some established libraries or pattern etc.



> > Hi Pawel, Thanks for the insight. I would give a try.
> >
> >
> > Being a common scenario, is there any existing work already
> > present for
> > this, so that I don't have to reinvent the wheel? I guess there should
> > already be some established library / code sample which people follow.
> > What do people normally do?
> >
> > > when intercepting action for the first time (no logged user),
> > > You can save submited data along with request uri and put it into
> > > session/database
> > > then after login (inside login action), check if these informations
> > > are present in sesion/database
> > > and forward to desired action with all the params that You have
> > > collected before login.
> >
> >
> > > > My requirement is this:
> > > >
> > > > 1. User fills a form and submits.
> > > > 2. If he has not logged in, login form comes up.
> > > > 3. after logging in, the data automatically gets
> > submitted and next page comes.
> > > >
> > > > I am new to struts and unable to figure out the natural
> > solution, even after a lot of googling. As I understand step
> > 2 should be easy using interceptor, but how to get step 3 work?
> > > >
> > > > I am using struts 2.1.8.
> >
> >      
> > _________________________________________________________________
> > New Windows 7: Find the right PC for you. Learn more.
> > http://windows.microsoft.com/shop
> >
> Notice:  This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@...
> For additional commands, e-mail: user-help@...
>
     
_________________________________________________________________
Windows 7: Simplify what you do everyday. Find the right PC for you.
http://windows.microsoft.com/shop

Re: How to get Login page while submitting a data form

by DNewfield :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sanjaya Kumar Patel wrote:
> Curious to know what is the common practice. Would like to hear if
> people are using some established libraries or pattern etc.

ACEGI^H^H^H^H^HSpring Security.

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


Re: How to get Login page while submitting a data form

by Haroon Rafique :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Today at 1:14pm, DN=>Dale Newfield <dale@...> wrote:

DN> Sanjaya Kumar Patel wrote:
DN> > Curious to know what is the common practice. Would like to hear if
DN> > people are using some established libraries or pattern etc.
DN>
DN> ACEGI^H^H^H^H^HSpring Security.
DN>
DN> -Dale
DN>

+1.

Sanjaya, Spring Security will remember which URL user was trying to access
before the login and will replay that URL after successful login .
However, I'm not aware of Spring Security ability to replay POST data from
a form.

Hope that helps.

Later,
--
Haroon Rafique
<haroon.rafique@...>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...


RE: How to get Login page while submitting a data form

by Sanjaya Kumar Patel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> DN> ACEGI^H^H^H^H^HSpring Security.

> Sanjaya, Spring Security will remember which URL user was trying to access
> before the login and will replay that URL after successful login .
> However, I'm not aware of Spring Security ability to replay POST data from
> a form.

Dale, Harun, Thanks a lot for the direction.

I saw ACEGI a bit and then am thinking to first try writing own interceptor - basically extending the suggestion in the book "Apache Struts 2 Web 2.0 Projects." Will post the code once successful.

thanks,
Sanjay

     
_________________________________________________________________
Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop

Re: How to get Login page while submitting a data form

by DNewfield :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sanjaya Kumar Patel wrote:
> I saw ACEGI a bit and then am thinking to first try writing own
> interceptor - basically extending the suggestion in the book "Apache
> Struts 2 Web 2.0 Projects." Will post the code once successful.

For security this is pretty much always a mistake.  You don't want bugs
in your security implementation, and the best way to avoid them is to
use a library that has been extensively tested by others.

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@...
For additional commands, e-mail: user-help@...