File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2, Spring Security 3.0 and Ajax

 
Glen Divers
Ranch Hand
Posts: 61
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Scenario: After logging in, user runs Struts 2 action that displays a .jsp page that uses Struts2-Jquery tags to create a tabbed display that make Ajax calls to access their content from other struts actions. Walk away and let the session expire. Clicking on one of the tabs invokes the login page from Spring security as it should, except the login page appears as the content of the selected tab.

How(Can) I configure Spring security so that the login page always appears as a display in it's own right. If the login program was a Struts Action I'd do this as a "redirectAction", but I've no idea how to acheive this in Spring/Struts intergration.

Regards
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's the Ajax call that has to deal with the lack of logged-in-ness; it needs to redirect based on a response. I usually just use an error code, check for the error code in the response, and redirect via JavaScript.

This isn't really Struts-related; I'm going to move it to... Spring, since that'd be what needs to provide enough information for your JavaScript code to do the right thing.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic