Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaRanch Mock Exam Question

 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Following is the question in Mock Exam

Which of the following statements are TRUE? (Choose Two)

a> The web.xml deployment descriptor can reside outside the WEB-INF directory as long as it has been properly mapped.

b> The servlet class files can reside as a sub-directory of WEB-INF named classes.

C>Files in the WEB-INF directory can be served dircetly to the client.

d> Files in the WEB-INF directory can not be served directly to the client.


I think the answers are a,b,d. Any advice??

Thanks
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry. Reading Mistake.
 
Vishwa Kumba
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My answers: b, d
 
trivikram Kumar
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even my answer is b,d
 
seemapanth Joshi
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should'nt the answers be B, C.


b> The servlet class files can reside as a sub-directory of WEB-INF named classes.

C>Files in the WEB-INF directory can be served directly to the client.


I take "served directly" to mean that the entire directory structure along with the contained files is visible.
 
Greg Fox
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The classes in the WEB-INF are not directly accessable. The classes are placed there but they are not directly accessed. Think about where you put files such as HTML and JSP files. These are the types of files that are directly accessable.
 
seemapanth Joshi
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry ..my bad.. , it would be above WEB-INF and under webapps in tomcat or and the application sundirectory. So answers would be "cannot be directly served".

Coming to answer A, that is

The web.xml deployment descriptor can reside outside the WEB-INF directory as long as it has been properly mapped.


And What would "properly mapped" means. I tried putting web.xml outside of WEB-INF, that is under webapps and it works still and I guess so answer A is correct too although I dont know what would "mapping" mean.

[ May 22, 2005: Message edited by: seemapanth Joshi ]

No Iam sorry My application does not run, the page was getting re-loaded from the cache so I guess answer A is wrong.
[ May 22, 2005: Message edited by: seemapanth Joshi ]
 
Kumar J
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Can you show the code that you have put where outside also (web.xml) things work fine?
Correct mapping means the xml file is put as per the dtd with all the required and optional falling in place in the right locations.
bye
 
seemapanth Joshi
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Can you show the code that you have put where outside also (web.xml) things work fine?


I am sorry..I had corrected the message immediately, I think you did not notice. if I put the web.xml file above WEB-INF, it did not work, because the container looks for web.xml in WEB-INF. I get HTTP Status 404. But anyway following is the web.xml:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic