Accessing one bean in another without using annotation

Accessing one bean in another without using annotation

I would say we have to use annotations and Injection to get the bean inside another bean.
But in case you are interested to get it without using annotation you can use the following in the action/actionListener

TheBean theBean = (TheBean)FacesContext.getCurrentInstance() .getExternalContext().getRequestMap().get("theBean");

Where theBean is one we are interested to get it from being in the other bean.

That is it!

See how you would solve these known algorithm problems

Check if there are three numbers a, b, c giving a total T from array A

Find longest palindrom from sequence of characters

Implementing tokenizer and adding tokens to the linked list

Check if two strings are anagrams or not

Finding missing numbers from billion sequential number list file

Java solution for checking anagram strings – tell if phrases are anagrams

Changing decimal number to its binary equivalent

Kadane’s algorithm in C – Dynamic Programming

Find K Complementary numbers from array Java implementation

testing k complementary pairs algorithm with junit

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*