It says: Identify techniques that access a declared JavaBean component. How is it different that 10.1 which talks about getProperty and setProperty? Any idea?
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
How is it different that 10.1 Hint: How do you call a method (say printMe() )declared in a bean class, assuming you have access to it. regds. - satya
<jsp:useBean id="abc" .../> <% ... abc.methodX(); ... %> Is this what you mean? But a bean is not supposed to be used this way.
Manjunath Subramanian
Ranch Hand
Joined: Jul 18, 2001
Posts: 236
posted
0
I think 10.3 refers to the various attributes of a <jsp:useBean> tag like id,class,type,beanName. As the statement indicates ,it refers to 1)the need to know the different ways of creating and using a JavaBean component. 2)to understand constraints like we cannot use "class" and "beanName" attributes together in a <jsp:useBean> tag and so on.. Hope this helps, Manjunath
Madhav Lakkapragada
Ranch Hand
Joined: Jun 03, 2000
Posts: 5040
posted
0
Is this what you mean? I was thinking yes. But a bean is not supposed to be used this way. Michell's notes says,
A declared java bean can also be accessed using: scriptlets Expressions Custm Tags
And sure the code you posted is a scriptlet. So yes. IMO, the issue is not whether you are supposed or not? It is "Can you access the bean like this or can't you?" My answer is "Yes, JSP allows such access." Other thoughts please..... Thanks. - satya
Axel Janssen
Ranch Hand
Joined: Jan 08, 2001
Posts: 2164
posted
0
I don't expect that exam is about good programming practice. So I will try to take every possibility into consideration. If its possible to access JavaBean method by scriptlet I will mark it, although its bad programming practice.