aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Objectives 10.3 WHAT WE HAVE TO DO HERE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Objectives 10.3 WHAT WE HAVE TO DO HERE" Watch "Objectives 10.3 WHAT WE HAVE TO DO HERE" New topic
Author

Objectives 10.3 WHAT WE HAVE TO DO HERE

Hussain
Ranch Hand

Joined: Nov 22, 2001
Posts: 110
10.3 Identify techniques that access a declared JavaBean component.
The Answer From the Notes is :-
A declared JavaBean can also be accessed using: (the name specified in the id attribute of <jsp:useBean>
. Scriptlets
. Expressions
. Custom Tags
But i couldn't understand if Someone plz tell me.


Muhammad Hussain<br />Sun Certified Java Programer (SCJP2)<br />Sun Certified Web Component Devloper SCWCD
Victor Htet
Ranch Hand

Joined: Apr 09, 2000
Posts: 70
Pls. refer to JSP 1.2 spec page 70 , Semantics of jsp:useBean actions


SCJP,SCWCD,SCEA,SCDJWS
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

On my test, I received a bunch of questions in this area, plus it was one of the two areas I did the worst. So read the specs, like posted above, and try it out in real code. Try all the different ways to use the usebean. I think you will find it very helpful. I wish I could help more, but I still need more work in this area myself
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
Hi,
A scriptlet is Java code enclosed within <% %> tags. An expression is similar to a scriptlet, except the expression inside its <%= %> tags must return a value. A custom tag is a user-defined tag. Its functionality is defined by a Java class known as a tag handler class.
Your JavaBean (or is it JavaBean(tm)? ) reference is treated just like any other object reference within the tags. You can invoke methods on it, whatever. For example:
<jsp:useBean id="myBean" class="SomeBeanClass" />
<% for (int i=0; i<myBean.getSomeValue(); i++) {
myBean.doesOtherStuff();
} %>
Total bean value: <%= myBean.getTotalValue() %>
<!--etc-->
regards,
Anthony
Denis Duan
Greenhorn

Joined: Jan 09, 2009
Posts: 2
From the spec JSP 2.0 (page 1-99)

"A jsp:useBean action associates an instance of a Java programming language
object
defined within a given scope and available with a given id with a newly
declared scripting variable of the same id."

It helps clear the concept!!!


SCJP
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61241
    
  66

Denis Duan, please avoid posting to 6-year old posts. Please read this for more information.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: Objectives 10.3 WHAT WE HAVE TO DO HERE