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 8050049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:57:36+00:00 2026-06-05T06:57:36+00:00

I have observed an interesting thing in my JSF2.1/Richfaces 4.2 application. Some how all

  • 0

I have observed an interesting thing in my JSF2.1/Richfaces 4.2 application. Some how all response.sendRedirect() calls inside either Filter (or) JSF Bean action methods are not working.

If we use location.href on client side (Browser), it is working fine.

Any suggestions on what could be causing send redirect failure? I have tried below signatures.

response.sendRedirect("/appRoot/mypage.xhtml");
  or 
(HttpServletResponse) facesCtx.getResponse()).sendRedirect(((HttpServletRequest)request).getContextPath()+"/appRoot/mypage.faces");
  • 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-05T06:57:37+00:00Added an answer on June 5, 2026 at 6:57 am

    Some how all response.sendRedirect() calls inside either Filter (or) JSF Bean action methods are not working.

    That can happen if the request is actually an ajax request. The webbrowser doesn’t translate redirects on XMLHttpRequest to the main window at all. The JS code who’s sending the ajax request is responsible for that. It needs either a special/different response so that the JS code understands that it needs to change the window location, or the JS code itself needs to be altered so that it can handle the response accordingly.

    If the ajax request is initiated by JSF itself (e.g. <f:ajax> and so on) and the Java code is running inside the JSF context, then you should be using ExternalContext#redirect() instead. This autodetects if the current request is an ajax request and will return a special XML response which tells the JSF ajax engine to change the location of the window. If you’re not inside the JSF context (e.g. inside a Filter), then you need to create this special XML response yourself as follows:

    response.setContentType("text/xml");
    response.getWriter()
        .append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
        .printf("<partial-response><redirect url=\"%s\"></redirect></partial-response>", url);
    

    See also:

    • Using JSF 2.0 / Facelets, is there a way to attach a global listener to all AJAX calls?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a WebCenter Spaces application and have observed some strange behaviour in
I have a simple MVC 4 (Beta) Application and just observed something that I
I have observed some unexpected or at least not-perfectly-matching-my-needs behaviour of textboxes bound to
We heavily use Smarty for all our front end templating. I have observed the
I have observed that my I run my iPhone application (native) the display lights
We have been having an interesting issue with the Eclipse update when some of
I have observed my php application behaving rather strangely on the server that it
There are two places where I have observed this. Both are AJAX calls which
I have observed that, very infrequently, Internet Explorer (7 or 8, it does not
I have 600,000+ observed data that I want to sample proportional to its ZIP

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.