Win a copy of Head First Android this week in the Android forum!

David Jones

Greenhorn
+ Follow
since Dec 26, 2003
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 David Jones

Hi all,

I want to check the record value from the database in JSP by using DynaProperty. Here is the code:



I want to check the value with the string 'CHECK', if not equal, then print the value. Otherwise, just print 'Error'. However, the above code does not work. Could anyone tell me what's wrong with this code?

Thanks,
David
Hi all,

I have some questions about ServletContext and ServletConfig:

On HFSJ, page 151:
"By the time the servlet is running service methods, it's got a ServletConfig"

(Q1) Does this mean that ServletConfig can only be available in service() method (i.e. after init() method)?
(Q2) How about the ServletContext? Is ServletContext also ONLY be available in service() method (i.e. after init() method)?

On HFSJ, page 308:
"jspInit() called from the servlet's init() method, so by the time jspInit() runs there is a ServletConfig and ServletContext available to the servlet"

(Q3) As HFSJ mentioned, we can use ServletConfig and ServletContext in jspInit() method (i.e. can use them before _jspService() method, not like Servlet that only be avilable in service() method). Is this because the init() method of the generated servlet has already been executed and so ServletConfig and ServletContext are available in jspInit() method (since init() called jpsInit())?

Thanks
David
Hi all,

Could anyone tell me the invoking sequence of the listeners on the session by the Container :

Case 1 : if an new attribute is added to the session
1) HttpSessionAttributeListeners.attributeAdded
2) HttpSessionBindingListeners.valueBound

Case 2 : if the attribute is already exist in the session
1) HttpSessionAttributeListeners.attributeReplaced
2) HttpSessionBindingListeners.valueUnBound
3) HttpSessionBindingListeners.valueBound

Case 3 : if the attribute is remove from the session
1) HttpSessionAttributeListeners.attributeRemoved
2) HttpSessionBindingListeners.valueUnBound

Am I right?

Thanks
David
Hi Jesus Angeles,

I also think that if the answer C include the class is nested, then option C is correct. This is because setParent is not 100% be invoked.

David
In Page 554, Q12 is as follows :

Which is true about the lifecycle of a Simple Tag?
A. The release method is called after the doTag method.
B. The setJspBody method is always called before the doTag method
C. The setParent and setJspContext methods are called immediately before the tag attributes are set
D. The JspFragment of the tag body is invoked by the Container before the tag handler's doTag method is called. This value, a BodyContent object, is passed to the tag handler using the setJspBody method.

Answer : C
Hi all,

Could anyone help me with this question?

Thanks
David
Hi Mat and Darya,

I have very little experience in using Servlet and JSP, so I want to study this exam in order to enrich my knowledge. When I am reading HFSJ, I can understand the topics. However, in the Final Mock Exam, I found that many questions are new to me since HFSJ does not cover these questions in details in the previous chapters. So I want to know any book that can help me to know more about the Exam....

David
Hi all,

I only got about 50% on the captioned exam. I found that the exam is much diffiuclt then I expect. Now I don't have confidence in passing the exam. Apart from the HFSJ, is there any book someone can recommend such that I can learn more before the exam?

Thanks
David
Hi all,

On Page 557, Q17, I don't understand why A is correct. This is because the question mentioned that "Both tags are declared to be non-empty and non-tag dependent in the TLD". But as A :

<my:simpleTag>
<my:complexTag />
</my:simpleTag>

It seems that complextTag is empty body. So why A is the correct answer?

Thanks
David
On page 554, question 12,

Which is true about the lifecycle of a Simple tag? The answer is C :

C. The setParent and setJspContext methods are called immediately before the tag attributes are set.

However, on page 506 :

"If the tag is nested, call the setParent(JspTag) method."

So if the tag is not nested, no setParent(JspTag) will be called. So I think that C is also not correct (since the question did not mention the tag is nested). Am I right? Or am I missing something?

Thanks
David



Thanks
David
Hi all,

A question not related with the Exam but I want to know is Tomcat support multi-CPUs? If yes, how to make Tomcat support multi-CPUs?

Thanks,
David
85%, 9 questions not answer correctly. Take 60 minutes for the first run, another 30 minutes to review (some questions choose another answer after review...). I use the followings to prepare the exam:
1) K&B Book, what a great book
2) Dan's Mock exam
3) this web site
Could anyone tell me when I will get the cert. from Sun?
David
17 years ago
Hi Jarrod,
I did not find errata page related to this question. It seems that it is a typo now
David
Hi all,
Here is the question from K&B's CD:
class Bing {
Bing(String s) {};
Bing() {};
}
class Bang extends Bing {
Bang() {};
Bang(String bangS) {super(bangS);};
// inserted here
}
The question is which line can be inserted at // without produces error. One answer is
Bing b = new Bing() {"Foo";};
However, I am not understand why the above statement is OK. So I inserted this line and compile, following error is raised:
Bang.java:9: illegal start of type
Bing b = new Bing() {"Foo";};
^
Bang.java:9: <identifier> expected
Bing b = new Bing() {"Foo";};
^
2 errors
Why such error produced in compiling?
Thanks,
David
Hi Jacky,
Is this the same for the String references? e.g.
String a = new String("ABC");
String b = new String("AB");
b = b + "C";

Is a and b refer to the same object "ABC"?
THanks,
David