Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PLease help me in getting these quetions fromk mock!!!

 
Amitkumar Dhama
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all please help me out I am getting confused with these questions.


1.In a distributed environment which are true.
a.Separate instance of non default servlet context will be available on each jvm
b.Separate instance of servlet context will be available on each jcm
c.Default servlet context will be available only on one jvm
d.There is only one instance of servlet context across all jvm


2.Session can be implemented (consider cookie is not working).
a.Using http header.
b.Hidden form fields


3.Servlet container has just called destroy() method.
a.Time out has been exceeded.
b.None of the request can ever be serviced by this instance.
c.All thread created by this servlet are done


4.Consider taglib with prefix �seq� supports a tag �lib� expects a parameter named limit of type int which are the correct use of this tag
a.< seq:lib >20</ seq:lib >
b.<seq:lib limit=20></ seq:lib >


Please do answer above questions with a little explanation if any body is having......

Thanking in advance....
 
Charith Fernando
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.In a distributed environment which are true.
b. Separate instance of servlet context will be available on each jcm
*** in each JVM there will be a seperate servlet context instance

2.Session can be implemented (consider cookie is not working).
b. Hidden form fields
*** the hidden field can be used to pass the session id and keep track

3.Servlet container has just called destroy() method.
b. None of the request can ever be serviced by this instance.
*** when the container calls the destroy method that means that the servlet has finished servicing all the requets and after this it wont be able to service any other request unless it makes a new instance of the servlet

4.Consider taglib with prefix �seq� supports a tag �lib� expects a parameter named limit of type int which are the correct use of this tag
b. <seq:lib limit=20></ seq:lib >
*** this is the way to pass a value to a tag... the other way doesnt work coz it asks for a particullar attribute and the other way it doesnt know where to put the attribute...

PS: i'm not an expert... i'm planning of doing the exam next week.. so if there's any errors that i have made.. please point it out to me.. thanks..
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Here is my answers

1.In a distributed environment which are true.
a. Separate instance of non default servlet context will be available on each jvm
b. Separate instance of servlet context will be available on each jcm
c. Default servlet context will be available only on one jvm
d. There is only one instance of servlet context across all jvm



My answers : a,b,c



2.Session can be implemented (consider cookie is not working).
a. Using http header.
b. Hidden form fields



My answer is B.



3.Servlet container has just called destroy() method.
a. Time out has been exceeded.
b. None of the request can ever be serviced by this instance.
c. All thread created by this servlet are done



My answer is c


4.Consider taglib with prefix �seq� supports a tag �lib� expects a parameter named limit of type int which are the correct use of this tag
a. < seq:lib >20</ seq:lib >
b. <seq:lib limit=20></ seq:lib >


My answer is B.

Thanks
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see no big difference between option a and b in your first question. Both mean the same.


Servlet specification guarantees that in a distributed environment every web-application has one servlet context available in every JVM except the default web-application whose servlet content exists in only one JVM. The servlet content of this web-application is know as default servlet content.


a,b,c are correct.

And in question 3 both options b and c are correct.
[ December 05, 2005: Message edited by: Vishnu Prakash ]
 
Umakanth Godavarthy
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Answers
1.a and c (page31 of servlet-spec)
2.b
3.b and c (page28 and 29 of servlet-spec)
4. doubtful (why is it b, can we have attributes without quotes, becoz with xml we cannot.)
 
Umakanth Godavarthy
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I see no big difference between option a and b in your first question.

In option b the type of servlet-context, like default or non-default is not specified.

-Thanks
[ December 05, 2005: Message edited by: Umakanth ]
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In option b the type of servlet-context, like default or non-default is not specified.



Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic