Dan T

Ranch Hand
+ Follow
since Jun 15, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dan T

Be sure to read over the servlet/JSP spec !

Those are very important as you will find some important conditions and information missing in some books.
On page 267 of HF question 7 of mock exam, it says that:

C. Attributes bound into a session are available to any other servlet that
belongs to the same ServletContext. (correct option)

By 'bound', are we talking about the method of setAttribute()? I thought attributes in the HttpSession are only available to servlets within the session iteself. And what does belong to the same ServletContext mean ?

And on page 59 of spec,

A servlet can bind an object attribute into an HttpSession implementation by name.Any object bound into a session is available to any other servlet that belongs to the same ServletContext and handles a request identified as being a part of the same session.

Thank you.
Hello,

I thought I saw a link to the JSP pdf a few days ago. Did Bert take the link off already ?
Thank you Ram.

This was the exact document I was looking for.
Cheers.
Ty for your replies.

One more question, I heard that 1.4 is a lot harder and has more material than the previous 1.3 version. Was there any big topics on the 1.3 that won't be on the 1.4 (ie. like how the whole awt and swing was on the java programmer 1.2, but wasnt on 1.4)?
Maybe because I don't live in the US, so it won't be available on 8/25. I live in Canada (close enough to the US), and amazon gave me an email they will only be available on 9/15.
Hello,

It says that the more we post, the higher chance we might win. I have no background on Java Web Services, but I do want to take this exam in the near future. Without any background, I don't understand what *could* I be posting in this section of the forum.
Hello,

I have been waiting for this book quite a long time, and therefore, I have decided to study for SCBCD before SCWCD. I have already passed the SCBCD, and the book is still in delay. I pre-ordered the book, and just got an email stating the HF book will arrive on Sept 15. However, for myself, school starts in early September, and therefore I cannot wait for the HF book to be delivered. Maybe there are others like me trying to sqeeze another certificaiton before school starts, so could anyone kindly recommend some resources that could cover the difference between the 1.3 to 1.4?

Resources I currently have:

Java 2 Web Developer Certification study Guide (sybex, for 1.3)
Manning SCWCD exam study kit (for 1.3)
Servlets and JavaServerpages (by Kevin Jones)
[Sams] Java for the Web with Servlets, JSP, and EJB (servlet 2.3, Jsp 1.2)
[ August 21, 2004: Message edited by: Ryan Wong ]
actually its in the Bean provider must not do list (no time to check now)

ie must not use AWT
not use native library

.... etc
I dont know where, but if I remember correctly, we are only allowed to declare final static fields. If not declared as final, we must use them as read-only, (ie, not assigning them to other values).
Maybe my question was not clear.

Things you can do in your Home Business methods:
- getEJBHome
- getEJBLocalHome
- isCallerInRole(..)
- getCallerPrincipal
- setRollBackOnly
- getRollBackOnly
- JNDI env
- access other beans
- Resource manager

Hence we are not allowed to call getEJBObject() and getPrimaryKey() on the EntityContext because there is not an EJBObject associated with the bean (it is in the pool). What if we called the create() or findByPrimaryKey() method before invoking the getEJbObject in the home business? Calling these methods will either create and find an EJbObject, so will it return the references in the home methods?
We arent allowed to get a reference to EJBObject or get primary key in Home methods because the bean has no EJBObject (they are inside the pool).

What would happen if we called create() / findByPrimaryKey(..) on the home interface, then try to get a reference to those? Might be a meaningless thing to do, but would it return the references?
The bodyguard stays in the container (alive) when the bean is passivated. If the EJbObject (bodyguard) was passivated as well, how can the client make another business call? It would have no way to tell the container that he/she is ready to make another call.

Session:
Once the EJBObect (bodyguard) is created, it is NOT alive in the container if the container calls ejbRemove() (either client calls remove, or times out during active), when the container crashes, and times out during passivate (for statefull, gc is called).

Entity:
The EJBObject is alive once the client calls the create() on the home interface. The EJBObject might be on the container as long as the client does not remove the entity in the database, because the client is allowed to invoke the findByPrimaryKey(key), and states the Container can either make or find an EJBObject. (Not sure if guaranteed by container)

Originally posted by Hai Lin:
Hi, guys,
Feel big doubt for the HFE page 432, question 4

Given the container-managed unidirectional relationship:
Foo (0-1) --> Bar (0-1)
And the object relations:
f1-->b1
f2-->b2

What will be true after the following code runs? (Choose all the that apply.)
f2.setBar(f1.getBar());

A. f1.getBar() == null
B. b2.getFoo() == null
C. b1.getFoo() == null
D. none of the above

the answer given by the book is A, B. Actually, why B is correct? Since the Foo and Bar are unidirectional relationship, that mean, foo can getBar(), but bar cannot get Foo, there should NOT have method like b2.getFoo() existing.

Thanks a lot for your advice.

Hai

[ August 12, 2004: Message edited by: Hai Lin ]



This is because every Foo can only have 1 Bar, and every Bar can only have 1 Foo. Thus, if u set B1 to F2, F2 will not have relatioship with B2 because F2 can only refer to 1 Bar, which is B1. Now, B2 refers to nothing.
What would happen if you narrow something that doesnt need to be narrowed ?

(ie. calling create() / findByPrimaryKey(...) )