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. ::::end of question:::::
The answer they give is A and B. But I do not believe it is correct. I have tried to duplicate the behaviour myself and what I have found is if <jsp:useBean> includes the "type" attribute, and not the class attribute, a missing bean instance is NEVER created.
So I believe that only B is true.
Who is wrong? Me? Or this big company who I will not name?
posted 7 years ago
I agree with you. I've tried that myself, it doesn't create a new bean. There is also an excerpt from HFSJ: 'If type is used without class, the bean must already exist. If class is used (with or without type) the class must NOT be abstract, and must have a public no-arg constructor.'