ViewScoped « Bean « JSF Q&A

1. @EJB in @ViewScoped managed bean causes

I've been banging my head around with a @ViewScoped managed-bean. I'm using primeface's "schedule" component in order to display some events. When the user clicks on a specific button a method ...

2. JSF: EvaluationException and NPE when method in a @ViewScoped bean is called

fellow Java warriors!
I have this managed bean to handle the Rede (Network) entity related operations called RedesBean (NetworksBean). I have three pages to insert a new network: redes/nova.xhtml (new.xhtml), which ...

3. Viewscoped bean doesnt retain it's state when returning to the same view?

Im currently testing on JSF Bean that make use of ViewScope I notice this behaviour. When having this button :

<p:commandButton value="Submit Data to Server" 
    ajax="false" update="debugPanel" />
I can see ...

4. Howto access JSF2 @ViewScoped beans via ExternalContext?

In JSF1 you can access the bean instances of your current FacesContext by

ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext()
ev.getApplicationMap().get(beanName) // get an @ApplicationScoped bean instance
ev.getSessionMap().get(beanName) // get a @SessionScoped bean instance
ev.getRequestMap().get(beanName) // get a ...

5. Use of JSTL/core tags screws up ViewScoped Bean

I think I have run into a bug in Mojarra 2.1.0. Maybe I missed something but damned if I can see it. I rely a lot of @ViewScoped beans to save state ...

6. Jsf2 view parameters and viewscoped beans

How can I access the view parameters from a viewscoped bean?
I have a page almost with the same content as this:

    <f:viewParam name="name" value="#{}" />

<ui:define name="content">

7. My jsf FacesBehavior class reloads the viewscoped bean

I've a Facesbehavior class that works fine. But as soon as the tag is used within the .xhtml, every single commandbutton that is clicked on, results in reinitialisation of the viewscoped ...

8. JSF 2 - Where does a @ViewScoped bean live between requests?

I'm trying to better understand the low-level workings of a @ViewScoped bean in JSF 2. Where does the server keep the view-scoped bean between requests? I've noticed that my view-scoped beans ...

9. Restore view (displaying viewScoped Bean) after calling JSP for file upload

I'm using JSF 2.1 RI. I've a JSF Page with multipart upload form defined like:

<form method="post" enctype="multipart/form-data" action="/addAttachment.jsp">
    <input type="file" value="${myBean.filePath}" id="filePath" name="filePath"/>
    <input type="hidden" value="${}" ...

10. Getting a GET request param into an @ViewScoped bean

I have a (request-scoped) list from which the user may select a "PQ" (list of links). When clicked or otherwise entered into the browser the main page for each PQ shall ...