This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!

Prem Kashyap

Ranch Hand
+ Follow
since Oct 10, 2006
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 Prem Kashyap

You should not think that because web.xml is not shown, then it wont find the servlet.

The fact is when you appear for SCWCD exam, it first clealry explain about the assumption you should make when complete code is not there. In this case, it is to be assumed that web.xml is defined properly.

I mean it doesn't make sense to test your knowledge on missing web.xml file.

The answer is simple. It is D. There is not doGet() defined for the servlet, and hence typing an URL in the browser address bar uses the GET method.

I got this similar question in the real Exam and I am 100% sure the answer is D and they were not testing your alertness that the question does not contain web.xml

And a servlet is mapped using servlet mapping. Which mean you can pass servlet name as "ABC" in the URL whereas the real servlet class name is "XYZ"

Regards
Prem Kashyap
[ May 15, 2008: Message edited by: Prem Kashyap ]
Congrats! So whats next!

Regards
Prem Kashyap
SCJP 1.4 : 88%
SCWCD 1.5 : 89%
As I said in my previou post, null is evaluated as 0 in arithmetic operation (+,- etc) and evaluated as false in logical operation(&&,|| etc)). (For relational operation, like <, >, >= etc , i am not sure if it evaluated to 0 or false. my guess it evaluated to false. Just write a small program and find out.

Regards
Prem Kashyap

Originally posted by liqiang yang:
Hi all,

What will happen when you attempt to compile and run the following JSP page contents?

<%
request.setAttribute("Two","2");
Integer One = new Integer(1);
%>

${One + 1}
${Two}
${Two + 1}

The answer is: 123
I can't understand it. Can anybody figure it out? Thanks alot.



$(One + 1) : evalauates to 0 + 1 = 1 ( Attribute with name "One" could not be found in any of the scope, so EL consider it as 0 in arithmetic operation) (considered as false in logical operation)

${Two) : it is simpe. attribute names "Two" is found in scope and its value is 2.

${Two + 1} : Simple.Value of attribute "Two" (2) + 1 = 3

so it prints: 123 (There are no line breaks)

Regards

Prem Kashyap
[ May 14, 2008: Message edited by: Prem Kashyap ]
Thanks a lot for the wonderful explanation.

Regards

Prem Kashyap
Thanks Charles for correcting me.

However what is the behavior when we call jsp:forward from a jsp page 1?. The control goes to the forwarded jsp page 2. Then the rest of the jsp page 1 after the forward does not execute? Is that correct?

Regards

Prem Kashyap
Once you have dispatched the request to JSP1, the service method ends there.
Once you give RequestDispatcher.forward(req,resp), the control goes to the JSP1. Nothing in the service method afer the forward statement will execute.

From JSP1, you will be able to dispatch it to JSP2.

So in this way request attribute are thread safe, as at one time only one component is reading or writing the request attributes.

Regards
Prem Kashyap
Just try running the program? I think it will work fine.. But I am not sure.

Regards
Prem Kashyap
And for appearing again, you need to pay for the exam once more

Regards
Prem Kashyap
SCJP 1.4 - 88%
SCWCD 1.5 - 89%
You have HFSJ 1.4, then I would suggest that would be enough. For topic not covered in 1.4, (Dynamic attributes, c ut, and some advances tag attributes), please read the Servlet and JSP , JSTL specs..

Regards
Prem Kashyap
Thanks.. What i found out that code based question were easier then theoritical question.

I would say 25% are very easy which you would have faced in Marcus exam or HF mock exam.

50% are medium. You should be able to answer 40% easily if you have done enough practise. You need to write code and try out various combination to see the output.

25% i would say were difficult. And theory question asking about the container and security were bit tough.

You should give the marcus exam and the HF mock exam.

As far my preparation goes:

I read HF book twice
Read selected topics from Marcus tutorial
Read selected topics from Servlet Spec (Security,Filter,deployment descriptor)
Read selected topics from JSP Spec (jsp standard actions)
Read selected topics from JSTL Spec (core tag)

Went through the API of PageContext, JSPContext, All Tag related interfaces and classes. Also ServletRequest, HttpServletRequest API..etc..

Pracised with sample code for EL, Custom Tags, JSP Standard Action, Error Page handling etc.. You need to practise JSP related topic very well.

Last 2 days I went through the Mikalai Zaikin notes for 1.4. They are really good and are the best option to read on last day before exam.

Also i went through Peabody on SCWCD patterns. they are also very nice. although i answered one question on pattern wrong

Best of luck to all of you..

Regards

Prem Kashyap
[ May 12, 2008: Message edited by: Prem Kashyap ]
13 years ago
Hi All,

I am glad to post that I have cleared the SCWCD 1.5 exam with 89% score.
Yes, I am bit sad that i could not cross 90%.. However i will live with my score.
Thanks to you all for posting in this site and giving useful tips and guidance.


Regards

Prem Kashyap
SCJP 1.4 - 88%
SCWCD 1.5 - 89%
13 years ago
I scored 97% in Mock Exam 2 of Marcus Green! Shall i give all the mock exams given on Marcus site..

By the score i got, do you all think that I am ready to go for the exam!

Regards
Prem Kashyap
I am not asking about the return value from doEndTag..
What i am asking, if we return EVAL_BODY_BUFFERED from doStartTag(), then will the body of the tag will be evaluated once? (provided <body-content> is not empty in the TLD)

And giving EVAL_PAGE from doEndTag()will not evaluate the body. It will evaluate the rest of the page after the tag ending.

Regards

Prem Kashyap
Thanks John,
I have confirmed by running a small program and if we try to access bean property which does not exist, it throws an exception.

Omi : The exception will be caused if you are tying to access a property of a bean that does not exist.

So if "foo" is a bean which is stored in request scope.
If you give ${foo.omi), where there is no getter for omi (as there is no propery named omi in the foo bean), then it will cause exception. Irrespective of whether you give it in c:set var or c:set target of any other JSP tags..

In case the "foo" bean does not exist as attribute in any of the scope,

and you give ${foo.omi}, this will return null (displayed as blank in JSP page), as foo itself was not found, so there was no attempt to get property omi

Regards

Prem Kashyap