• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Info on objective 10.3

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Jim Bertorelli
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<jsp:useBean id="abc" .../>
<%
...
abc.methodX();
...
%>
Is this what you mean? But a bean is not supposed to be used this way.
 
Ranch Hand
Posts: 236
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic