JSF and the concept of a "backing bean


Web tier: servlets, JSP, Web frameworks: JSF and the concept of a "backing bean

  1. JSF and the concept of a "backing bean (1 messages)

    I'm doing a quick poll on using JSF managed beans as "backing beans" for JSP pages.

    Several tools auto-generate backing Java class for each JSP page. Although this notion of a 1 to 1 relationship with a (JSF) JSP and a single backing bean is not required in the specification, but I think it is a good practice to do it as much as possible..

    The alternative being that you could have multiple backing beans referenced in a page, or you even have a single bean's methods/properties referenced in multiple pages..
    This is where it gets a little hard manage in my opinion..

    Does anyone else have a preferred methodology for handling this?

    Just curious...
  2. I generally have one backing bean for a series of pages with a method for each page. That has always worked well for me.

    My rule of thumb is if your system walks through a set of pages in order using the same data bean for all of it, have a single backing handler class too.

    thanks - dave