struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hubert Rabago <jakartau...@yahoo.com>
Subject RE: session time-out in pop-up windows
Date Mon, 03 Nov 2003 15:50:10 GMT
Chinmay,

If you don't want to mess with your URLs or add parameters (and I don't blame
you), you can pass the list of popup urls to your filter:

<filter-name>AuthFilter</filter-name>
<filter-class>com.chinmay.AuthFilter</filter-class>
<init-param>
  <param-name>popupUrl1</param-name>
  <param-value>/infoBox.do</param-value>
</init-param>
<init-param>
  <param-name>popupUrl2</param-name>
  <param-value>/notice.do</param-value>
</init-param>

You can collect these in your filter ("all init params that start with
'popupUrl'") and respond accordingly.

Hubert


--- "Rabago, Hubert" <hubert.rabago@nwa.com> wrote:
> You'd have to find a way to identify the popup.  It could be because of
> the requested resource ("myPopup" or any page with "popup") or a special
> request parameter which will only be sent by a request for a popup
> window ("href='/mycontext/myinfodisplay.do?myActualParam=1&isPopup").
> Either way, the filter will have to be notified somehow that "Hey, this
> particular request here is a popup!"
> When it does, then you can redirect the popup to a different page which
> does nothing but send the parent to a different url and close itself.
> 
> -----Original Message-----
> From: chinmay.r.parikh@accenture.com
> [mailto:chinmay.r.parikh@accenture.com] 
> Sent: Monday, November 03, 2003 9:10 AM
> To: struts-user@jakarta.apache.org
> Subject: RE: session time-out in pop-up windows
> 
> 
> Hubert
> 
> Thanks for this.
> 
> But how would filter recognise that the request was sent by a popup?  As
> I understand, the process is like:
> - pop-up window opens
> - Page would read global forward url from the struts config file (the
> page to display)
> - It will check filter:  if "filter pass" is true display url page else
> display error page.
> 
> So I am not sure, how Step 3 and then 4 could be implemented.
> 
> 
> -----Original Message-----
> From: Hubert Rabago [mailto:jakartauser@yahoo.com] 
> Sent: 03 November 2003 14:50
> To: Struts Users Mailing List
> Subject: Re: session time-out in pop-up windows
> 
> Another way might be:
> 1. user clicks link for pop-up window, window pops-up
> and initiates the web request
> 2. Filter intercepts the request and senses that the
> session has timed out
> 3. Before redirecting, filter recognizes that the
> request was sent by a popup, and instead redirects to
> a different pop-up page
> 4. The session-expired pop-up window shows in the
> browser with JS code to (a) redirect the parent page
> to the login window and (b) close itself.
> 
> --- chinmay.r.parikh@accenture.com wrote:
> > I am using Filters to determine whether session has
> > timed out or no and
> > redirect user to login page.  The implementation
> > class extends Action
> > class so you could display appropriate messages on
> > login page when user
> > gets redirected to it due to time out.
> > 
> >  
> > 
> > However this does not work well when there are
> > pop-up windows:  e.g.
> > When user clicks on a hyperlink in a parent browser
> > window, a new pop-up
> > window opens to display information.  But when the
> > session has timed
> > out, the pop-up window displays "session time out
> > error" and redirects
> > it log in page.  What I intend to achieve is that
> > when the user clicks
> > on the hyperlink and if the session has expired new
> > pop-up window does
> > not open and is the redirected to login page in the
> > parent browser
> > window itself.
> > 
> >  
> > 
> > One possibility is to associate the hyperlink on the
> > page with a form
> > submission and then verify session time out in
> > Action class but then how
> > to open pop-up window from within Action class?
> > 
> >  
> > 
> > Any other possibilities?
> > 
> >  
> > 
> > Any suggestions/pointers will be much appreciated.
> > 
> >  
> > 
> > Regards
> > 
> >  
> > 
> > Chinmay
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
http://launch.yahoo.com/promos/britneyspears/

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message