• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mock test doubt

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Ranchers;

Following are some of question in whch i have a query...In each question i have specified my answer with my understanding and also mentioned my doubt on individual question...

Queston 1.>>
A session can be invalidated by which of the following:
Please select three correct answers
A. After a default period of inactivity, say 30 minutes
B.Client side user closes the browser
C.After a specified period of inactivity, say 10 minutes
D.Client side user machine crashes
E.Explicitly invalidate a session through method calls

In this question my answer is A, D, E
and given anser is : A,C,E
Let me know what should i attempt for this type of question in exam

Queston 2.>>
.Based on the following information, please construct the full path for the servlet.
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/common/util/MailServlet.class
B.c:/temp/test/com/jiris/common/util/MailServlet.class
C.c:/temp/mail/test/com/jiris/common/util/MailServlet.class
D.c:/temp/test/mail/com/jiris/common/util/MailServlet.class

My ANS : C
Given ans : B
In thiswhy answer is been consider as B ...url-param will not taken in to care...?

Question 3. >>
In which directory you will most likely find the file myBaseUtil.jar?
A. example/WEB-INF
B. example/lib
C. example/WEB-INF/lib
D. example/WEB-INF/classes
E. example/META-INF/lib

given ANS : C
my ans: c e....
in this; If answer can't be E then please explain for this...

Question 4.>
Consider the following contents for two JSP files:
In file companyhome.jsp:

<html><body>

Welcome to ABC Corp!

<%@ page errorPage="simpleerrorhandler.jsp" %>

<%@ include file="companynews.jsp" %>

</body></html>



In file companynews.jsp:

<%@ page errorPage="advancederrorhandler.jsp" %>

<h3>Todays News</h3>


Which of the following statements are correct?
Select 1 correct option
A.When companyhome.jsp is requested, the output will contain "welcome..." as well as "Todays News"
B.companyhome.jsp will not compile
C.companynews.jsp will not compile
D.Both the files will compile but will throw an exception at runtime.
E.None of these

Given ANS : B
My Ans : D OR B
Please let me know which one would be the corect answer for this question.


Would appreciate if somebody help me out on specified query..

Thanks & Regards;
Brijesh
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
aaahh brijesh.. thats a long list of questions .. anyway.. lets try to answer this..

1.

In this question my answer is A, D, E
and given anser is : A,C,E


Here i think you have not given full question so not sure about option C but sure option D is not correct !!!.. If the client system crashes..from the server point of view it's nothing but the remote machine has not made any request .. untill some point of time.. thats it..!! once the system is back.. it can continue to request hope.. the session has not timed out..
hoooohh.. such a long story isn't it.. next things all i vl make it cut short.. dont worryy..

will answer other queries in different posts..
 
Sarat Koduri
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Continue.. with the second question...
2.

url-param will not taken in to care...?



Dude.. usually url-pattern will be used for the servlet mapping but it will not have any relation to the exact path of servlet..
 
Sarat Koduri
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now the third one...

3.

can't be E then please explain for this...



Usually whenever we jar the files .. it supposed to have a META-INF/ directory with the manifest file to tell about the dependencies.. but there is no requirement like this jar shoud itself be inside the meta-inf directory.. and i do not think somebody do that also..
 
Sarat Koduri
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Finally the fouth one..

4.

My Ans : D OR B
Please let me know which one would be the corect answer for this question.



Here they are using directives and if at any point of time we see a directive then the mapping will be done at compile time thats it.. the story should end here..

Hope it made some sense..
 
Brijesh shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
4.

Here they are using directives and if at any point of time we see a directive then the mapping will be done at compile time thats it.. the story should end here..

Hope it made some sense..[/QB]

Thanks for your reply of my post...

I still have bit confusion for Question 4..
The code given in this question i tried running as you said maping will be done at compile time but i am geting error during run time as in the code they have metioned diferent eror pages for individual jsp.

In mock test they ave given answer as A...

Would appreciate if you sugest me its proper answer.

--
Brijesh
 
Sarat Koduri
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

but i am geting error during run time



brijesh.. the thing is usually we do not see the different phases of jsp ..if not all the time atleast most of the time.. i mean, when you request the jsp for the first time.. it does all the work and will tell us the story of erros.. if you still wanted to see that error is coming at compile time.. try and directly invoke this jsp using the querysting jsp_precompile..

for example:

this will just compile the jsp page and will let you know the story of errors during this page..

As far as i know only include attribute of Page directive can occur more than once in both include and included pages.
so the option B must be correct..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic