Servlet « Bean « JSF Q&A

1. Access managed bean from separate web application on same server?

I have two applications. The first called app1 is a JSF 1.2 application. The second called app2 is a basic Servlet application. Is it possible to access a specific managed session ...

2. Viewing the contents of Session, Application and Request Bean

It would make a lot of sense to be able to monitor the contents of Session, Application and Request Bean while developing a JSF app but as far as I know, ...

3. jsp, servlets, faces and beans?

i´ve read a little about java's structure and could someone tell me if my view of all these components are correct:

JSP corresponds a View
Servlet corresponds a Controller
Bean corresponds a Model
Faces correspond ...

4. JSF - get managed bean by name

I'm trying to write a custom servlet (for AJAX/JSON) in which I would like to reference my @ManagedBeans by name. I'm hoping to map: http://host/app/myBean/myProperty to:

public class MyBean {

5. JSF Managed Beans in a Servlet

Is there a way to access JSF managed beans from a servlet?

6. Open Popup from servlet or jsf managed bean?

hello Is there any way to open a popup from a servlet I have an asynchronous process running , and I need to somehow notify the user when finished, without having to refresh ...

7. How to access managed bean and session bean from Servlet

Here is how my commandLink work

 <p:dataTable value="#{myBean.users}" var="item">
         <h:commandLink value="#{}" action="#{myBean.setSelectedUser(item)}" />     

8. JSF vs. plain JSP + Beans?

I have the option of doing my next project in either JSF or JSP. Other languages/frameworks are not an option. I don't want to use any of the visual component libraries like ...

9. How to call servlet or web service from JSF backing bean?

I seriously cannot find the correct way to do this. I have this method and it works, but it seems kind of a work around to do something so basic.

  FacesContext ...

10. In jsf 1.2, defining a locale from bean causes IllegalStateException in getOutputStream

I'm trying to understand how this happens and how to solve it. I have a jsf request bean with a jsp page that looks like this: (Summarized)

<f:view locale="#{drcBean.userLocale}">
the backing bean code:
public Locale ...

11. Java EE 6: How to inject ServletContext into managed bean

(Java EE 6 with Glassfish 3.1) I have a property file that I want to process only once at start up time, so I did this

public class Config implements ServletContextListener{


12. How to register a JSF managed bean programmatically?

I'd like to register/add a Managed Bean class programmatically (from within a Servlet init()) into application scope. How can I do that with JSF 1.2?

13. Servlet created JSF bean

I hope I understood you correctly... I assume you want to construct a Bean (within the servlet) and store it in some context (application, session or request) and then have a JSF-page access it using the "normal" JSF-expression language. If that is the correct interpretation of your question, then th answer is YES. Configure the bean in jsf's faces-config.xml. The bean-name ...

17. Invoking Servlet from Managed bean

19. Servlet to Backing bean

21. Calling a servlet from a backing bean

22. Access managed bean from a servlet

Hi I want to invoke a managed bean method in a Servlet. And so I used the following code: final HttpSession session = req.getSession(true); BackingBean bean = (BackingBean ) session.getAttribute("managedBean"); I am able to get the value when the page from where the action has been initiated is not mapped to the backing bean's navigation rule. But in some cases where ...