• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

addActionError

 
chris locke
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi gurus,

I have a basic login that calls addActionError from within the Action, and it works perfectly with <s:actionerror />

My problem is that I want to do a similar call from within an Interceptor. Can it be done? If so, how?

Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can get the action in an interceptor, right? (Bearing in mind that if your interceptor stack includes "workflow" you need to make sure your interceptor order matches your desired behavior.)
 
chris locke
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe I'm misinterpreting, but yes, the action is encompassed in the interceptor. When the interceptor succeeds I can get to the action, but when it fails it never gets to it so I'm looking for a callback to the form where I can add a coding statement like "addActionError".

Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think *I'm* probably the one mis-interpreting: what, specifically, are you trying to do? You have the action, so you can call addActionError on it.
 
chris locke
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically I have an interceptor that checks the user's status. If the user has timed out, they'll be kicked back to the login page no matter where they are in the app. What I'd like to have is some form of user notification to let them know why they need to log back in.

Thinking about it more now, I'm wondering if maybe I should just kick the user to a different login page which has this user message included?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't have a completely separate page for that, unless there's a compelling reason to have one. But since you're doing a redirect, unless you're using the message store interceptor, it would be lost anyway, right? So I'd keep it in session and just check if there's a message there or something.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic