Isha Garg

+ Follow
since Mar 12, 2010
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 Isha Garg

Hi All,

I was just searching for J2ME stuff on javaranch, but didnt find much. I cant even see a seperate topic for SCMAD.
Isn't it that important to have a separate topic for SCMAD:(

Actually I am a stranger to J2ME. I am SCJP and SCWCD. But I am getting a good job opportunity in J2ME.
So I want to know is it good to go for J2ME? What future does it hold?
I know that at present iphone/ipad andriod applications are growing at a fast rate, but I dont have any idea how different J2ME is from Android.

I am very confused about this. Can anyone please advice on this?
And also if I have to start with J2ME, then what can be the best book to learn it as a beginner.

Thanks in advance.

Anupam, I used First version of the book.. But I followed 2nd version also. I had 2nd version online.
There is not much difference... But if I found some topics confusing in first edition then I used to check it in 2nd version..

Ankur, I followed head first books and the notes provided by Frits.
I guess, Headfirst book is enough.. But in this book we should not miss even a single word..
I was preparing for it long back. But I think 1 month of preparation is atleast required..
13 years ago
I used Headfirst's servlets and jsp.
I had old version of this book, there are many errors in that book so referred new book as well..

Enthuware mock exams were good for practice...
13 years ago
Hi All,

I took my exam today and scored 88%.
The exam was bit tough for me:( but I passed and that matters:)

Thanks to all of you for all your support.

I have a doubt regarding my certificate details.

How do they link my SCWCD certification details with certmanager.

On the exam score report, I can see only candidate Id which is no where there If I check my details on certmanager site.

How do Sun know that I am the same person:(

Actually my name is changed. I bought voucher for SCWCD with a different name then It was at the time of SCJP.

Bit worried, will Sun be able to identify that I am the same person...

Hope I wont be asked to take the exam again:(:(

13 years ago
Consider the code for doGet method of a servlet.

Which of the given LOCs can be inserted at //1 to log the message as well as the exception's stack trace?
1. req.log(e, "Unknown User");
2.req.log(e, "Unknown User");
3.this.getServletContext().log("Unknown User",e);
4.this.getServletContext().log(e, "Unknown User");
5.The stack trace of the exception cannot be logged using log(...) methods.

Correct answer is 3.
But I say it should also be 4.
As, in ServletContext we have message log(Exception e,String message)
Aah.. I have got the errata for this at

Page 420
Answer for the number 1 exercise
ANSWERS FAILS at request time! The �person� attribute is stored at request scope, so the <jsp:useBean > tag won�t work since it specifies only a type." The answer is wrong since the attribute scope is defined as request in the <jsp:useBean>. The correct would be "Prints Name is Evan."

Note from the Author or Editor:
VALID This exercise has dogged us from the beginning. It will be complete replaced in the next edition.
Reference: Chapter -8 Page 420 of new book and 416 of old book

I have following two classes

abstract class person with attribute name.
class Employee which extends Person with attribute empId.

I have following code in my servlet
Person p = new Employee();
request.setAttribute("personBean", p);

In my jsp I have:
<jsp:useBean id="personBean" type="com.example.Employee" scope="request">
<jsp:setProperty name="personBean" property="name"/>

Name is:: <jsp:getProperty name="personBean" property="name" />

If I run it, it works fine and displays Evan (which is expected according to me)

But the book at page 420 says, that it should fail at request time! The "personBean" attribute is stored at request scpde, so the <jsp:useBean> tag wont work since it specifies only a type. The container knows that if you have only a type specified there must be an existing bean attribute of that name and scope.

I dont understand why should it fail???
Am I doing anything different as it is not failing in my case??

One Point I noted is, In old book they have not specified any scope so it will by default search person in page scope so it should fail which is right,
but in new book they have specified scope="request" on <jsp:useBean> tag, so according to me it should not fail in this case.

Hi All,

I purchased enthware mock tests yesterday. Money has been successfully transferred to their account.
But I have still not received any email from them regarding license information. On their website they say it is instantaneous.
As soon as they receive money they will send the license.

I am planning to take my test next week. Dont know how long they take to provide license.

If you have any idea regarding how long can they take...?
If it is going to take 2-3 days,then probably I should cancel my order:(

So Does that mean there is error on page 671 of new book having following text:

Dueling <auth-constraint> elements:
A and B refer to two <security-constraint> elements partially of fully overlapping <web-resource-collection>

Contents of A: No <auth-constraint> element
Content of B: <auth-constraint>Admin</auth-constraint>

In above case, book says Everybody has access to 'UpdateRecipes'

If there is errata in above mock question then Is this also wrong in the book?
Or there is something wrong in my understanding??
Thanks Pedro.
Ya, you are right even at p-257.. It is written that There is one ServletContext per VM. There is one ServletConfig per servlet, per VM.

Sorry for making the topic confusing...
Ya, Thanks for the reply. It makes sense to me now...

But again regarding clustered environment, as on page 257 of HeadFirst, it says only HTTP session objects move from one VM to another.
All other things are copied.

Even if wwe see in the figure at page 257, only session object is different for both VM1 and VM2, all other things like servletcontext, servlet config are copied on both the JVMs.

Does not it mean that applications in clustered environment also share the same servletContext?
Thanks a lot for this example.

Ya,I agree that Servlet2 will print the value set in Servlet1,
what is confusing me is the text 'same ServletContext'

How can we say that Servlet1 and Servlet2 belong to same ServletContext? Is it something related to context path..? or does it mean like any servlet belonging to the same application..?
Thanks for your reply Nidhi.
I am also very confused with this line:

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.

Is there any example for this??