Deep Gagan

+ Follow
since Aug 03, 2007
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
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by Deep Gagan

I have a question, suppose we have 100 threads e.g T1, T2, T3 . . . T100. I want threads to run in sequence. First T1 completes then T2, then T3….at last T100. Is there any way to implement this ?
You can say each thread prints its Name .
So my output should be
T1 T2 T3 T4.........T100

Hi Friends

Once again you guys proved a great help. Last time it was for SCJP where I scored 98%.
Now, I have cleared SCWCD with 91%. It is very nice score but, as I missed only 1 question in SCJP to score 100%. This time, I was trying my best to get my dream score ....Any ways I am very very happy with 91% .... Heartly Thanks to GOD & you guys for such a great help

Following are the detail on my learning & how I cleared SCWCD

Exam Experience:
My personal experience was it was tougher than SCJP, because we need to memorize lots of APIs & I am bad at memorizing the APIs. I felt only 5-6 questions were very difficult rest was mix of lil difficult & lil easy. Time to attempt the questions in the exam is more than enough, no worry in that case. So be calm & think twice while answering any question.

Time To Prepare:
Prior to exam, I had good experience in jsp servlets but not in tags, filters,DD etc. I took around 3 months to prepare for the exam. This time may vary from person to person depending on time he spends daily for the study, or grasping power or prior experience in java/j2ee projects or marital status (married ppl have to give time to family too ) etc

Head First Servlets and JSP ( I read this book 2-3 times, 2 times is must after that when ever you feel, you are weak in any particular area read that chapter)

Mock Exams:
1. HFSJ first edition (Scored only 75 % , I attempted this just day before the exam day and after seeing this score I postponed my exam for around 10 days )
2. Niko's mock exams (really good, must do)
3. Marcus Green mocks (nice one, must do)

1. Enthuware mocks -- It is really worth paying that amount. It gives best practice for real exam & conepts.

1. Frederic Esnault notes (good for revision, in sync with HFSJ & highlighted good points).
2. JSTL specs. (lil bit, to clear my doubts)
3. Peaboy Design patterns notes.
4. Ashok's API reference notes.
5. Sample web.xml and TLD by Michael John
6. Dale Seng's PowerPoint slides: JSTL Animation, Servlet Listeners
7. ScwcdHints by Jothi Shankar Kumar

1. Try to create your own notes, this will help in last days of exam.
2. Try to practice as much as possible.
3.Try giving as many mock exams as possible
3. Don't take test until you feel you are ready. Trust me you will come to know yourself that you are ready now.
4. Exam time is more than enough so don't make hurry in exam.

SCJP (1.4) - 98%
SCWCD (5.0) - 91 %
7 years ago
Hi Everybody

I am preparing for SCWCD and THANKS for your guidance & support for my preps. I have read HFSJ two times & done Niko’s & Marcus mock exams(both are good). In an average I have scored around 80 % in these exams(Niko’s Marcus). I was about to take exam in 2-3 day, but yesterday I had tried HFSJ mock exam. In which I scored very less 65% only . I expect a lot from myself & want to score good in the exam . So, I have postponed my exam for another week.

Here I need from you guys is, suggest me some Free good quality mock exams which you have tried & can match the quality of real exam. It will be really good help.

Thanks a lot again.


I have tested these scenarios... & your following lines are absolutely correct....

EL only gives blank if either there is no bean named person in any scope or if the property you access on the person bean exists and is null.
If you access a property on a bean which doesn't exists (like gender in our example) then an exception is raised...

Also can you please get this to writer's notice that this info is wrong in the book, so that they can correct in the next version.


Thanks for the information. But i am not convinced, as the followig text is given in the HFSJ(page-395) matches our discussion.

<snippet from book>
Assume that there is not an attribute named "foo", but there IS an attribute named "bar", but that "bar" does not have a property or key named foo.

According to book all of these EL will print blank.

I will try this & share the info with you.

HFSJ on page (395) it is written EL handles null values gracefully.
Even if foo attribute is not present ... ${foo} will print nothing(blank) & will NOT throw NullPointerException.

But in practice exam Page-424

Q17 Which about EL access operators are true.

A. Anywhere the .(dot) operator is used, the [] could be used instead.
B. Anywhere the [] operator is used, the .(dot) could be used instead.
C. if .(dot) operator is used to access a bean property but the property doesn't exist, then a runtime exception is thrown
D. There are some situations where the .(dot operator must be used and other situations where the [] operator must be used.

Answer given is A & C
I am not convinced with answer C.

Any suggestions or clarification?



Thanks for sharing the link, it really helps.

Sorry, there was typo in my post...i have edited the message now...

Answer given in book is E....
I have doubt in the followig question.
Source :- HFSJ chapter 7's Mock Exam (page 336)

Q6 Given
<%@ page isELIgnored="true" %>
what is effect (choose all that apply)

A. Nothing, this page directive is NOT defined.
B. The directive turns off the evaluation of EL code by the JSP container in all of the web application's JSPs.
C. The JSP containing this directive should be treated by the JSP container as a well-formed XML file.
D. The JSP containing this directive should NOT have any EL code evaluatd by JSP container.
E. This page directive will only turn off EL evaluation if the DD decalres a <el-ignored>true</el-ignored> element with a URL patter that includes this JSP.

Answer(in book) is E.

Is it really necessary we should have <el-ignored>true</el-ignored> in DD to use isELIgnored="true" in our JSPs....???
Given a valid deployment descriptor (WEB.XML) containing the following code


And given that cfg is a valid ServletConfig object and ctx is a valid ServletContext object which of the following statements are true?

Choose at least one answer.
A. cfg.getInitParameter("bestwebsite") will return
B. ctx.getInitParameter("bestwebsite") will return
C. ctx.getInitParameter("bestwebsite") will return
D. cfg.getServletContext().getInitParameter("bestwebsite"); will cause a compile time error
E. ctx.getServletConfig().getInitParameter("bestwebsite"); will cause a compile time error

I think answer is C & E. Is it correct?
In Niko's exams there is question
Q# 7 How can a servlet access the application’s ServletContext object? (3 correct answers)
a. getServletContext();
b. request.getServletContext();
c. response.getServletContext();
d. getServletConfig().getServletContext();
e. request.getSession().getServletContext();

Answer given is a,d,e

But i feel answer should be a,d only ....i have checked the APIs also ...Can somebody comment on this ?