Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7803227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:30:31+00:00 2026-06-02T01:30:31+00:00

It seems a very common problem. But I couldn’t find any working solution. We

  • 0

It seems a very common problem. But I couldn’t find any working solution. We are using Richafaces 4, Myfaces 2.0.5 and Spring security 3.0.X.

On session time for ajax/non ajax requests, the user should be redirected to log in page.after logging back he should be shown the previously performed ajax/non ajax operation.

We are not facing any issue with non ajax requests. But for ajax requests, the user is not redirected to log in page.

I have followed this link https://community.jboss.org/message/729913#729913 and implemented servlet approach. the solution worked in Firefox, not in IE 8.

There could be one more problem even if it is properly redirected to log in page on session time out. I am expecting a ViewExpiredException on successful login for the previously invoked ajax request.

I wanted to bring the ViewExpiredException, since both these problems could be related each other.

Any solutions/leads will be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:30:33+00:00Added an answer on June 2, 2026 at 1:30 am

    Since you use Spring Security 3.0.x, you can use custom sessionManagementFilter as described here

    The class com.icesoft.spring.security.JsfRedirectStrategy is available here

    If you are using Spring Security 3.1.x make these changes

     <beans:bean id="sessionManagementFilter" class="org.springframework.security.web.session.SessionManagementFilter">
        <beans:constructor-arg name="securityContextRepository" ref="httpSessionSecurityContextRepository" />
                <!-- this permits redirection to session timeout page from javascript/ajax or http -->
        <beans:property name="invalidSessionStrategy" ref="jsfRedirectStrategy" />
    </beans:bean>
    
    <beans:bean id="jsfRedirectStrategy" class="com.icesoft.spring.security.JsfRedirectStrategy">
      <beans:constructor-arg name="invalidSessionUrl" value="/general/logins/sessionExpired.jsf" />
    </beans:bean>
    <beans:bean id="httpSessionSecurityContextRepository" class="org.springframework.security.web.context.HttpSessionSecurityContextRepository"/>
    

    The only change to the JSFRedirectStrategy class are the first few lines:

    public class JsfRedirectStrategy implements InvalidSessionStrategy {
    protected final Log logger = LogFactory.getLog(getClass()); 
         private String invalidSessionUrl;
    private boolean contextRelative;
    
    public JsfRedirectStrategy(String invalidSessionUrl){
        this.invalidSessionUrl=invalidSessionUrl;
    }
    
    @Override
    public void onInvalidSessionDetected(HttpServletRequest request,
            HttpServletResponse response) throws IOException, ServletException {
        String redirectUrl = calculateRedirectUrl(request.getContextPath(), invalidSessionUrl);
    

    This works with IE8 also. If you are interested you can look at this blog also, but I never tried this as the above was much easier.

    FYI: If you do not do Spring there are many ways to do this:
    Primefaces does this on their site. link
    Or even simpler by importing Omnifaces jar link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm using the excellent Ancestry gem But while the documentation seems very complete
This seems to be a very common problem of mine: data = [1 2
This seems to be a very common problem, although I've tried the recommendations to
This is probably a common situation, but I couldn't find a specific answer on
This seems very basic and I must be missing something, but here goes anyways...
The problem seems very strange. I have a AJAX helper function within a same
What I'm trying to do seems very simple, but for some reason it feels
I have an issue that seems like very flaky behavour, is this a problem
Although it seems to be a very common issue, I did not harvest much
I faced a very odd problem It seems very funny looks like some stuffs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.