Question

In: Computer Science

In JSF practically speaking in terms of coding what is the difference between a managed bean...

In JSF practically speaking in terms of coding what is the difference between a managed bean and an unmanaged bean

Solutions

Expert Solution

  • Managed Beans are regular java beans class registered with jsf and managed by jsf framework.
  • Managed beans contains the getters and setters methods, business logics or even more.
  • Managed beans is used as a model for UI.
  • Managed bean is created with a constructor with no arguments, a set of properties, and a set of methods that perform functions for a component\
  • managed beans are considered the model and the controller at the same time
  • ex: @ManagedBean(name="message"), this annotation marks the managed bean.
  • Where as unmanaged Beans are not regular java beans class registered with jsf.
  • basically there are unmanaged objects, which we interrelate with unmanaged bean.

    Managed Bean:

    import javax.faces.bean.ManagedBean;

    import javax.faces.bean.SessionScoped;

    @ManagedBean

    @SessionScoped

    public class Beannn {

    private String message = "Hello managed Bean";

    public String getMessage() {

    return message;

    }

    public void setMessage(String message) {

    this.message = message;

    }

    }

    Unmanaged Bean:

    public class unmanaged{

    private String message = "Hello unmanaged Bean";

    public String getMessage() {

    return message;

    }

    public void setMessage(String message) {

    this.message = message;

    }

    }


Related Solutions

What is the difference between a working and a speaking outline? Be specific about the elements...
What is the difference between a working and a speaking outline? Be specific about the elements included (or not included) in each.​
What is the difference between Index Funds vs. Managed Funds?
What is the difference between Index Funds vs. Managed Funds?
Explain what are the terms difference when we speaking about virtualization, emulation and simulation methodologies.
Explain what are the terms difference when we speaking about virtualization, emulation and simulation methodologies.
Explain the difference between the terms managed care, referral, prior authorization, and precertification regarding insurance plan...
Explain the difference between the terms managed care, referral, prior authorization, and precertification regarding insurance plan requirements with an example provided for each. Cite references used.
What is the difference between virus, worms and trojan in terms of?
What is the difference between virus, worms and trojan in terms of?What does it do?How does it spread to another computer?Does it infect the file?Does there need to be user action for it to be spread?It can be attached to.
1) What does “cherry picking” mean in speaking? 2) What is the difference between using any...
1) What does “cherry picking” mean in speaking? 2) What is the difference between using any source or a credible source? 3) What is the structure of a simple speech, and what is the relevance of each section? 4) Why do you need to use transitions in your speech and between each section?
4. a) Distinguish between adaptive Huffman coding and Adaptive Arithmetic coding in terms of adaptation rate....
4. a) Distinguish between adaptive Huffman coding and Adaptive Arithmetic coding in terms of adaptation rate. b) Describe how quick changes are adapted and prevented in each method for source statistics? Explain in elaborate?
Globally speaking, what is the difference between relative and absolute poverty? Our text discusses poverty as...
Globally speaking, what is the difference between relative and absolute poverty? Our text discusses poverty as it pertains to women and children. What are the main points of this discussion? Why do analysts claim that economic development in low income countries depends on raising the social standing of women
1)Generally speaking, what is the difference between direct cost and indirect cost? Assume you are a...
1)Generally speaking, what is the difference between direct cost and indirect cost? Assume you are a manager, which one would concern you more when you are analyzing the cost of your product/service? Why? 2)Traditionally, in a manufacturing company, what is the most popular way to treat indirect cost? What is the advantage and disadvantage of that?
Im a but confused as to what the difference between print and return in terms of...
Im a but confused as to what the difference between print and return in terms of functions. I wrote the function: def myfun (a,b): return a**b myfun(5,2) but nothing gets printed out and i dont understand because i have done this before in other functions and it works.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT