This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes doubt about constraints of WEB-INF folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "doubt about constraints of WEB-INF folder" Watch "doubt about constraints of WEB-INF folder" New topic
Author

doubt about constraints of WEB-INF folder

P. Jain
Greenhorn

Joined: Jan 03, 2008
Posts: 15
I came across a question from javabeat

15) Which of the following statements are true?

a. A Servlet Container can host multiple Web Applications.
b. A single Web Application may contain multiple contexts.
c. A single Web Application can contain only one context.
d. Any resources with the 'WEB-INF' directory can be directly accessed by the clients.

i think the answer is a but the answer given is a and d.

please clarify..
[ June 17, 2008: Message edited by: Prince Jain ]

SCJP 5.0<br />SCWCD 5.0<br />Preparing for SCDJWS
Muks Sam
Ranch Hand

Joined: Apr 09, 2004
Posts: 47

Hey Prince,


Can you send the URL of question where did you see this question?

Also Just a thought, Pls. consider why option c should not be correct?

Thanks

Muks
Tony Ding
Greenhorn

Joined: May 11, 2008
Posts: 7
I don't think d is correct one, as I know client can't access any resource under WEB-INF folder


Passing SCWCD 84%
Jan Sterk
Ranch Hand

Joined: Jun 06, 2008
Posts: 139
Anyone, without having to have any knowledge of servlets/jsp, but with some boolean logic sense, can tell that either b or c is true, the other being false

And yes, c is true. And d is false.


SCJP 1.4 (81%)<br />SCWCD 5 (95%)
Ravi Singh
Greenhorn

Joined: Jun 02, 2008
Posts: 26
My answers

My ans a b c

a is definelty correct .

b is correct becuase if the application is used in distributed environment then the application will have multiple context

c is correct if the application is running in single JVM.

d is abslutely incorrect. If you try accesing it trhough client directly
you will get 404 error.
P. Jain
Greenhorn

Joined: Jan 03, 2008
Posts: 15
If such a question comes in exam should we take distributed application into consideration???
Juwonlo Ibigbami
Ranch Hand

Joined: Nov 03, 2006
Posts: 83
I think in other not to confuse ourself about the answer to questions, i think we always have moderators that have the final say to questions, because, i this case now, whose answer do we follow?

Juwonlo ibigbami
SCJP 5.0
Jan Sterk
Ranch Hand

Joined: Jun 06, 2008
Posts: 139
Originally posted by Ravi Singh:
...

b is correct becuase if the application is used in distributed environment then the application will have multiple context

...


Aren't you confused with sessions?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"Prince Jain",
Please check your private messages regarding an important administrative matter.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Jan Sterk
Ranch Hand

Joined: Jun 06, 2008
Posts: 139
Originally posted by Ravi Singh:
...

b is correct becuase if the application is used in distributed environment then the application will have multiple context

c is correct if the application is running in single JVM.
..


Originally posted by Jan Sterk:


Aren't you confused with sessions?


Ah well, meantime I found something about it in HF (p.255).

You probably mean that there's one context object per JVM. But they're completly identical, copies of each other, all the time. From the programmer's point of view, there's only one context object. If a servlet in JVM A adds or changes an attribute in the context, then a servlet in JVM B can use that attribute and gets the same new value.

Charles Lyons also states in his book 'Study Companion': one application, one context.

Clearly that's what the question refers to, otherwise it would have used the word 'object'.

Please correct me if I'm wrong about it. These kind of things are hard to check empirical.

Btw, it was me who was confused with sessions There's one session object only, migrating from one JVM to the other..

[ June 18, 2008: Message edited by: Jan Sterk ]

[ June 18, 2008: Message edited by: Jan Sterk ]
[ June 18, 2008: Message edited by: Jan Sterk ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt about constraints of WEB-INF folder
 
Similar Threads
WAR file doubt
WAR File Doubt
Enthuware practice test question
placing tld ?
Why not 'D' is correct.