redirect « Bean « JSF Q&A





1. Access request Attributes (Set in managed bean before redirect) in Filter by precreating FacesContext    stackoverflow.com

I am setting the request attribute in managed bean before redirect the request through faces-config as follows:

FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put("foo","bar");

return "redirect_success";
After this i m trying to access this request attribute in my filter through ...

2. JSF : I want to send POST request inside action bean    stackoverflow.com

I have an action bean method:

public void submitForm() {
// here bean save some information about input data in local DB
saveEnteredData();
//  I should redirect to external system page with post params.
}
So ...

3. Redirect to a JSP with a different content type from a JSF managed bean    stackoverflow.com

I have a dynamic form that I would like to show in a MS Word format when I press a button that calls a method in a JSF managed bean, but ...

4. JSF2.0 View Scope & Redirect    stackoverflow.com

I have the follwing problem with the new ViewScope in JSF2.0. I have a class annotated as a view scope bean with a @PostConstruct method

@ManagedBean(name = "userListController")
@ViewScoped
public class UserListController {

   ...

5. ending conversation scoped bean and then redirect when command button clicked    stackoverflow.com

I have a simple command button

<h:commandButton value="Create Form Event" action="#{formEventController.createFormEvent}"/>
which calls the following simple action listener
@Named
@ConversationScoped
public class FormEventController implements Serializable
{
    @Inject
    private Conversation conversation;

  ...

6. Redirect form managed bean constructor throwing "java.lang.IllegalStateException"    stackoverflow.com

In my JSF application I need to redirect from the the managed bean constructor. I have following code to do so:

HttpServletResponse httpServletResponse = (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
httpServletResponse.sendRedirect("HomeV.jsf");
but this is throwing following exception:
java.lang.IllegalStateException
   ...

7. JSF-1.2-Question. Strategy for saving current application-state(managed bean state) when redirecting to external service    stackoverflow.com

Definition --

  • There is working web-app with managed-bean state at some point.
  • this web-app posts request to external-application
  • External-application calls-back(http 'get' method) to web-app -- At this time application should restore managed-bean state as it ...