This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I came across the following question in the sun epractice exam:
Given a JSP page with the line: <jsp:useBean id="cust" type="test.beans.CustomerBean" scope="session" /> Which two occur? (Choose two.)
A A CustomerBean instance is created if the attribute name cust is not found. B The session is searched for a CustomerBean stored as the attribute name cust. C The CustomerBean instance is populated with the values of the parameters in the request. D A CustomerBean instance is always created and stored in the session with the attribute name cust. E The CustomerBean identified by cust is located in the application and then stored in the session for later use.
The correct answers stated are options A and B.
But I am doubtful about option A being correct. If we only use the "type" attribute and if the bean doesnot exist, does the container not throw an InstantiationException?