Wai Yip Lau

+ Follow
since Jun 20, 2005
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Wai Yip Lau

Actually I am doing an assignment about a synchronized hash table, but the requirement does not specify me to lock the whole table or single bucket. It seems I am going to redo the implementation as in the java package. I have found a sample source file of the ConcurrentHashMap and get some ideas about the logic. I am testing the code. Here are some resources to share:

[ November 28, 2006: Message edited by: Wai Yip Lau ]
I am writing my own hashtable that supports multi-thread. I want to allow simultaneous insertion and deletion on different buckets. Is it difficult to do? I have been thinking to do this using simple intrinsic lock. Do I need to use the new concurrent package?
Yup, you are right. But it seems asking me if it is already the whole model without more new attributes or methods.

It is a past exam question of my OO class. I am reviewing the exam.
I wonder what is the difference of thw following models:

I can just think of this:
Model A does not specify the role between two managers clearly like who is who's manager but just relate together. Model B specifies clearly who is who's manager. Any more significant difference?

I am doing HFSJ final mock. For Q22, it ask if I can use rd to include static content:

RequestDispatcher dispatcher = request.getRequestDispatcher("/segments/footer.html");

Why it is not a option???
Thank You.
Which of the given statements are correct regarding the following JSP page code?

<jsp:useBean id="mystring" class="java.lang.String" />
<jsp:setProperty name="mystring" property="*" />

Assume that the request for this page contains a parameter mystring=hello.


Select 1 correct option.

a. It will print "".

b. It will print "hello"

c. It will not compile.

d. It will throw exception at runtime.

A is correct.
It first creates a bean object,then the second line is irrelevant. There is a bean object in the page scope, printing it out should at least print something.
Is it a must for the form to use POST?
The question may be a bit old. According to the servlet 2.4 spec(p.283), the behavoir of sessionDestroyed is changed to notify before the session is invalidated since version 2.3.
Does these two attribute allow using resource outside the context??

One more thing, I have just seen that errorPage can be static objects(JSP 2.0 spec 3-79). That means even html that don't have a isErrorPage page directive can be set. Is it right?
It is in the http://www.jiris.com/online/page.do SCWCD mock exam 1.
I think I have read through the book but I really can't find anything about this. I can't recognize what it is. Please help.

Which of the following are LEGAL servlet error attributes?

Please select three correct answers.

A : javax.servet.error.status_code
B : javax.servet.error.exception
C : javax.servet.error.uri
D : javax.servet.error.message
E : javax.servet.error.query
In the API:
Ensures that servlets handle only one request at a time.

I don't think it is correct because the container can create several instances of servlet to handle request. Does the API want to tell each instance only handles one request at a time?
Based on the following information, please construct the full path for the servlet. Mark

Please select one correct answer.
docbase = c:/temp/
context path = /test
alias name = MyMail
servlet-name = com.jiris.common.util.MailServlet
url-pattern = /mail/*

A : c:/temp/mail/com/jiris/util/MailServlet.class
B : c:/temp/test/mail/com/jiris/util/MailServlet.class
C : c:/temp/test/mail/util/MailServlet.class
D : c:/temp/test/com/jiris/util/MailServlet.class

Correct answer is B. From explanation the url-pattern is also needed to construct the full path. But isn't the url-pattern is just a fake name that map to the servlet? Why it participate in the real path?
From the official SCWCD syllabus it's supposed to test the knowledge on 6 patterns including Intercepting Filter, MVC, Front Controller, Service Locator, Bussiness Delegate, and Transfer Object. But in some mock exams I do see some other pattern names that I can't recognize like Value Object, Data Access Object, Bussiness Object, etc. Are they in syllabus?
I would like to ask for the answer for question 5 of ch14(filters). The answer from the book states A and G. But I doubt if D is also the answer since it didn't provide an explanation and the one from C indirectly says D is correct. If I am wrong, please help me. Thank You!!