redirect « HTML « JSF Q&A





1. Using Post when doing a sendRedirect    stackoverflow.com

I have a requirement that a jsf page needs to be launched from a custom thin client in user browser (thin client does a http post). Since the jsf page may ...

2. send post data in jsf    stackoverflow.com

I just cannot figure this out, it looks really simple but I'm relatively new at jsf. Here is the old stuff: Plain old html form tag like this:

<form name="someForm" action="somewhere" method="post">
   ...

3. JSF redirect doesn't work    stackoverflow.com

I have a problem with redirecting a page in my JSF application. My navigation rule look like this :

<navigation-rule>
    <from-view-id>/index.xhtml</from-view-id>
    <navigation-case>
     ...

4. Why is this redirect not working? JSF    stackoverflow.com

Why is this redirect not working in my managed bean?

HttpServletRequest objHttpServletRequest = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
        FacesContext.getCurrentInstance().getExternalContext().redirect(objHttpServletRequest.getRequestURI() + "?abc=" + 1 + "&def=" + 2);
I think ...

5. faces-redirect=true in JSF    stackoverflow.com

I am using the ?faces-redirect=true in my JSF2 since I would like to redirect the user so the URL will be changed. In JSF1.2 I added </redirect> in faces-config. In JSF2 I have ...

6. Can't seem to redirect from a ViewScoped constructor    stackoverflow.com

I'm having trouble redirecting from a view scoped bean in the case that we don't have the required info for the page in question. The log entry in the @PostContruct is ...

7. ajax redirect not working    stackoverflow.com

This is my jsf code :-

  <h:commandButton id="cmdLogin" value="Login" actionListener="#{indexBean.login}">
                     ...

8. How to use ExternalContext.redirect() in JSF2.0?    stackoverflow.com

Consider a page webapp/myPage.xhtml:

...
<h:form id="myForm">
    ...
    <h:selectOneMenu id="..." required="true" value="#{myController.aValue}">
       <f:selectItems value="#{...}" var="..." itemValue="#{...}" itemLabel="#{...}"/>
    </h:selectOneMenu>
 ...

9. How do I ask my JSF implementation to redirect to new view through flash?    stackoverflow.com

I am using a flash module for site navigation (Freemind flash browser). However, I'm having trouble with navigation/redirection. A typical use case is as follows. From the welcome page, a user ...





10. strange jsf redirect behaviour    stackoverflow.com

I try to navigate to another page with redirect by assigning a navigation-rule. The webpage I try to redirect to works just fine when it is directly called. When I set the ...

11. How can i redirect in JSF 2.0    stackoverflow.com

I'm new in JSF and JSF 2.0 i want to redirect in JSF how can i do it? in html i can use tag for do this but in JSF i use h:outputLink ...

12. How to make a redirection in JSF    stackoverflow.com

I have a web-application where the users can be sent directly to some specific pages (such as a page where he can view or edit an item). To achieve that, we ...

13. FacesContext.getCurrentInstance().getExternalContext().redirect does not redirect immediately    stackoverflow.com

An Id is passing in as a Url parameter. I try to make sure that the id is an number. If not redirect to the main page

if(facilityId != null){
   ...

14. How to JSF redirect after few seconds    stackoverflow.com

I have one method on JSF Managed Bean, i want after user call method, and it do some business logic ,after that it will redirect some 2 seconds after some business ...

15. IllegalStateException on redirect    stackoverflow.com

I have a PhaseListener which listens on phaseId RENDER_RESPONSE. This faceListener calls this method:

   public void doLogin(ServletRequest request) throws IOException {
        FacesContext ...

16. Redirecting a user after container-based login using JAAS and JSF    stackoverflow.com

I'm trying to accomplish a jsf2-based form login where a user can go straight to his chosen URL after being redirected to the login-page. How can this be accomplished? My current ...





17. Jsf redirect to new window    stackoverflow.com

i'm making a JSF2.0 project using mojarra primefaces tomcat6.x. I made a select list and when i select item of the list i want to redirect to the selected url. It can ...

18. JSF external Site Redirect    stackoverflow.com

Hi i've been dealing with a problem with JSF, when it comes to redirect to pages inside my app it works just fine, but i haven't been able to redirect to ...

19. JSF Simple Redirect Controller Example    stackoverflow.com

Hi I'm trying to compare the redirect methods of various frameworks. I've made it through quite a few (cakephp, codeigniter, django, grails, rails, and zend) however I'm stuck trying to create ...

20. JSF 2 and Post/Redirect/Get?    stackoverflow.com

Please correct me if I'm wrong, but I'm thinking of all of my non-AJAX submits should use the Post/Redirect/Get (PRG) way, since GET should be used to refresh/query data, and in ...

21. JSF 2.0: how to save the view after redirect (target=blank)    stackoverflow.com

Imagine I have the jsf form and the button to print report on form data. The button needs to open the data on the new page (target=blank), but h:button doesn't suit ...

22. t:dataList causes redirect problems in JSF (java.lang.IllegalStateException)    stackoverflow.com

i'm trying to write simple jsf-based application, but there is a problem i cannot to solve. I need list of links on page, so i'm iterating to output them on the ...

23. How to redirect with params in JSF2?    stackoverflow.com

When I enter the page I want to rediect to another page with params (f:viewParam). How to do it?

24. JSF: Wait for party, then redirect    stackoverflow.com

I'm using JSF 2.0 and Glassfish 3.1 and have the following problem: I've got an application in which two users must participate. The first user should set up the session and ...

25. When to use NavigationHandler.handleNavigation vs ExternalContext.redirect/dispatch    stackoverflow.com

It would seem that the following are equivalent:

FacesContext.getCurrentInstance().getApplication().getNavigationHandler().handleNavigation("/index.xhtml?faces-redirect=true");

FacesContext.getCurrentInstance().getExternalContext().redirect("/testapp/faces/index.xhtml");
Are there any differences and when should each be used?

26. Consequences of JSF use    stackoverflow.com

Instead of appending ?faces-redirect=true to every action in my <h:commandButton />, I would like to use it once for good in faces-config.xml but I am not yet sure of the consequences ...

27. How to redirect to an anchor in JSF?    stackoverflow.com

Let's say I have this action in a JSF Managed Bean:

public String doSomething() {
    FacesContext.getCurrentInstance().getExternalContext().getFlash().put("msg", "Something was done successfully");
    return "view?faces-redirect=true";
}
My view has an anchor ...

28. Ajax redirection from inside a JSF PhaseListener fails    stackoverflow.com

My use case is the following: A JSF2 page has been displayed to the user. The page contains an Ajax-enabled button:

<p:commandButton value="#{msgs.reset}" process="@this"
   actionListener="#{reworkSearchMB.clearReworkSearch()}" tabindex="13"
   update="mainpanel messages" global="false"
  ...

29. 'manager' becomes NULL after redirection in case of SocialAuth libraries with JSF application?    stackoverflow.com

I am using SocialAuth libraries in my JSF application for providing 'login with google/facebook'. As shown below it requires me to stores the 'manager' in the session and then redirect to ...

30. Most elegant way to redirect to homepage in JSF    stackoverflow.com

in the upper left corner of my app there is a logo. After I click on it I would like to be redirecterd to home page wherever I am now. Of ...

31. h:commandbutton, how to redirect to external site?(JSF 2)    stackoverflow.com

When i use command button to redirect to pages, inside my project, u just need to give the name of the page with no extention, followed by ?faces-redirect=true in the action ...

32. JSF: JS redirection doesn't work for h:commandButton onclick event    stackoverflow.com

Migrating from a4j:commandLink to h:commandButton problem. this working case:

<a4j:commandLink  event="onclick" onclick="if (!confirm('#{resourceBundle.agreement_cancel_message}')) return false;" oncomplete="window.location.href='menu?agreementId='+ agreementId;"/>
this case with h:commandButton doesn't work,current page just refreshed:
<h:commandButton onclick="if (!confirm('#{resourceBundle.agreement_cancel_message}')) return false;window.location.href='menu?agreementId='+ agreementId;"/>
As I know,I ...

33. faces-redirect and the back button cause other links to work incorrectly    stackoverflow.com

I have a question surrounding faces navigation. So I have a page that takes a request parameter to load a specific user. This page displays a list of commandLink ...

34. JSF commandButtons action value seems to be ignored - redirects to frontpage    stackoverflow.com

I have a commandButton in JSF 2.0 with a actionvalue that I want to call a method in a bean and otherwise do nothing. However when I click on it, it ...

36. onInit() and redirect    coderanch.com

hello, This is my jsp code to do some action at pageload and this is the code in the backing bean for this jsp ( im using RAD and WAS 6.0) public void onPageLoadBegin(FacesContext facescontext) { System.out.println("this is a test.."); if ("norecords".equals(checkAvailabiliy())) { System.out.println("hello"); javax.faces.application.Application app = getFacesContext().getApplication(); FacesContext context = FacesContext.getCurrentInstance(); UIViewRoot view = app.getViewHandler().createView (context, "/showmessage.jsp"); ...

37. redirect    coderanch.com

38. JSF: Making Redirect the default    coderanch.com

39. Inserting post data in a context.redirect    coderanch.com

The application I'm developing has a requirement for the user to click on a button and a file is uploaded to a remote server. Furthermore, the user is not to be aware of the location of the file on the client machine. And on top of that the file to be uploaded can be one of several files uploaded, depending on ...

40. How to redirect in a jsf?    coderanch.com

41. Binding method + Redirect    coderanch.com

Hi, I have a home JSP page (not jsf), clicking the link of this home page take me to a JSF application. I have few buttons in the first page of the JSF application ( which gets displayed on clicking the link of home page). Somehow the binding methods of the buttons are not getting invoked if i navigate to the ...

42. Deciding which phase to listen to for redirect...    coderanch.com

due to a goofy way in which we're handling security on the project I'm working on, I'm having to trap a request with a phase listener, perform some logic, then redirect to one of a cople of pages (the decision is based on the state of some objects in the session). I've pretty much got that handled, but I wanted to ...

43. Redirect with post instead of get    coderanch.com

44. Post Redirect Get - a peculiar problem    coderanch.com

45. Trouble passing request params to redirect in navigation rule    coderanch.com

The following is an example to illustrate the problem I am having. Suppose I have a page that lists people in a company and another page that will add a person to a company: "listPeople.jsp" and "addPerson.jsp". For a specific company the urls would be as follows "contextroot/listPeople.jsp?company=x", "contextroot/addPerson.jsp?company=x". A command button on addPerson.jsp enacts a method that tries to add ...

46. Redirect after some time    coderanch.com

48. Lost FacesMessage on redirect    coderanch.com

50. Redirecting to an external payment website    coderanch.com

Well, I have an app that works with PayPal, but what it does is contact the Paypal server internally, supplying PayPal with callback URLs. I send the invoicing data to PayPal, it provides the merchant services, then vectors back to my app once the purchase has been made. My JSF backing bean services do a URL redirect to a URL returned ...

51. JSF Redirection    coderanch.com

52. Newbie question on RELOAD or REDIRECT?    coderanch.com

53. Redirect after download    coderanch.com

54. JSF faces-redirect not working    coderanch.com

55. Redirect problem on Websphere    coderanch.com

We have an application (JSF 1.2) that checks if a user is logged in or not. If not, a redirect is done to the login page. This works fine on Tomcat. But when deployed on Websphere 7 it fails. Firts request to a page an empty blank screen is returned. Second time (reload) the redirect works as it should be. I ...

56. doesn't end conversation after redirect    coderanch.com

57. JSF redirect    coderanch.com

Hi, I read as is an optional element which can be used to specify that the response is generated by the new view using redirect response rather than rendering the response as the current request. If we don't specify this element then the address bar shows the current page address even the response is generated by other page. I have ...

58. a4j:jsFunction outcome redirect    coderanch.com

59. Redirect and navigation problem    coderanch.com

Hey. I have a webapp, and if the user logs out, some method is called: public String logout() { // do some logout stuff return "login.xhtml"; } The problem is, that the browser address bar still has the file name of the file visited then the user logged out in it. http://www.example.com/webapp/editSomeStuff.xhtml?lots_of_other_stuff How can I "clear" that? The problem is, that ...

60. Confusing with JSF redirect    coderanch.com

61. redirect without http:// or http: ecc    coderanch.com

62. Redirect request    coderanch.com

63. Redirection after realm authentication    coderanch.com

No, you don't have a "login bean", since the container doesn't formally notify the application when a user has logged in. The only way to detect a login is to monitor page requests and check the HttpRequest object. When the userName/userPrincipal values transition from null to not-null, a login has just occurred. This is usually best done in a Filter. It ...

64. redirection from backbean    coderanch.com