Re: Need help writing an interceptor to force a user to change their password

2009-06-30 Thread Russell Neufeld

Thanks Nate and Tim.  Worked like a charm.

   Russ

Sarr, Nathan wrote:

Hi Russ,
 
   You may want to try creating a global result in your struts.xml:
 



/pages/user/login/force_change_password.jsp



Then in your interceptor return the result name "change-password" 
 
That is how we accomplished something similar to your pblem.
 
Hope this helps.

-Nate



From: Russell Neufeld [mailto:russ.neuf...@hds.com]
Sent: Mon 6/29/2009 5:19 PM
To: Struts Users Mailing List
Subject: Need help writing an interceptor to force a user to change their 
password



Hi all,
  
I'm trying to implement functionality which will force a user to a change-password page if a certain bit is set on their user account.  That is, no matter what action they are attempting to take, I'd like to intercept the request and show them a change-password page.  I've written a few struts2 interceptors before, but this one has me stumped.  I can easily get the user principal object and see whether or not I need to insert the change-password page, but I'm not sure what to do next.  I was thinking about trying to change the action object to one which would simply return a string pointing to the change-password jsp, but I don't know how to replace the action object on the invocation object (and that doesn't seem like a good idea).  I'd prefer not to solve this with a redirect because I'd like to use some of the context of current request in the rendering of the change-password page.


Any ideas?  Thanks,

Russ



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




  




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



RE: Need help writing an interceptor to force a user to change their password

2009-06-29 Thread Sarr, Nathan
Hi Russ,
 
   You may want to try creating a global result in your struts.xml:
 


/pages/user/login/force_change_password.jsp



Then in your interceptor return the result name "change-password" 
 
That is how we accomplished something similar to your pblem.
 
Hope this helps.
-Nate



From: Russell Neufeld [mailto:russ.neuf...@hds.com]
Sent: Mon 6/29/2009 5:19 PM
To: Struts Users Mailing List
Subject: Need help writing an interceptor to force a user to change their 
password



Hi all,
  
I'm trying to implement functionality which will force a user to a 
change-password page if a certain bit is set on their user account.  That is, 
no matter what action they are attempting to take, I'd like to intercept the 
request and show them a change-password page.  I've written a few struts2 
interceptors before, but this one has me stumped.  I can easily get the user 
principal object and see whether or not I need to insert the change-password 
page, but I'm not sure what to do next.  I was thinking about trying to change 
the action object to one which would simply return a string pointing to the 
change-password jsp, but I don't know how to replace the action object on the 
invocation object (and that doesn't seem like a good idea).  I'd prefer not to 
solve this with a redirect because I'd like to use some of the context of 
current request in the rendering of the change-password page.

Any ideas?  Thanks,

Russ



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





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

Re: Need help writing an interceptor to force a user to change their password

2009-06-29 Thread Timothy Orme

You should be able to just create a global result with the jsp you want.

Ala:


/passwordChange.jsp


Then have the interceptor return that string when needed. Any time it's true, 
the result will get hit and the user will get fowarded.

Unless I'm missing something.

-Tim

Russell Neufeld wrote:

Hi all,
 I'm trying to implement functionality which will force a user to a 
change-password page if a certain bit is set on their user account.  
That is, no matter what action they are attempting to take, I'd like to 
intercept the request and show them a change-password page.  I've 
written a few struts2 interceptors before, but this one has me stumped.  
I can easily get the user principal object and see whether or not I need 
to insert the change-password page, but I'm not sure what to do next.  I 
was thinking about trying to change the action object to one which would 
simply return a string pointing to the change-password jsp, but I don't 
know how to replace the action object on the invocation object (and that 
doesn't seem like a good idea).  I'd prefer not to solve this with a 
redirect because I'd like to use some of the context of current request 
in the rendering of the change-password page.


   Any ideas?  Thanks,

   Russ



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




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



Need help writing an interceptor to force a user to change their password

2009-06-29 Thread Russell Neufeld

Hi all,
  
   I'm trying to implement functionality which will force a user to a change-password page if a certain bit is set on their user account.  That is, no matter what action they are attempting to take, I'd like to intercept the request and show them a change-password page.  I've written a few struts2 interceptors before, but this one has me stumped.  I can easily get the user principal object and see whether or not I need to insert the change-password page, but I'm not sure what to do next.  I was thinking about trying to change the action object to one which would simply return a string pointing to the change-password jsp, but I don't know how to replace the action object on the invocation object (and that doesn't seem like a good idea).  I'd prefer not to solve this with a redirect because I'd like to use some of the context of current request in the rendering of the change-password page.


   Any ideas?  Thanks,

   Russ



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



Need help writing an interceptor to force a user to change their password

2009-06-29 Thread Russell Neufeld

Hi all,
  
   I'm trying to implement functionality which will force a user to a 
change-password page if a certain bit is set on their user account.  
That is, no matter what action they are attempting to take, I'd like to 
intercept the request and show them a change-password page.  I've 
written a few struts2 interceptors before, but this one has me stumped.  
I can easily get the user principal object and see whether or not I need 
to insert the change-password page, but I'm not sure what to do next.  I 
was thinking about trying to change the action object to one which would 
simply return a string pointing to the change-password jsp, but I don't 
know how to replace the action object on the invocation object (and that 
doesn't seem like a good idea).  I'd prefer not to solve this with a 
redirect because I'd like to use some of the context of current request 
in the rendering of the change-password page.


   Any ideas?  Thanks,

   Russ