Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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

WAR file

 
Richard Rex
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which path is required to be present within a WAR file?

A. /WEB-INF/classes
B. /WEB-INF/web.xml
 
singh santosh
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi rex,
Which path is required to be present within a WAR file?

A. /WEB-INF/classes
B. /WEB-INF/web.xml


A web application archieved as a WAR only differs in having a META-INF directiory (directly under context root)which have menifest.mf listing dependencies to other apis/resources.
So i think /WEB-INF/web.xml must be there in WAR (/WEB-INF/classes is optional as caontainer resolves any refernce to a sevlet class by first looking into /WEB-INF/classes folder then /WEB-INF/lib folder .So although
WEB-INF/classes can be there but it is not required )

regards
-santosh
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a strange question, but one which I suspect actually no longer applies in Java EE 5...

I think you are correct in saying /WEB-INF/web.xml is the correct answer under J2EE 1.4, which is the version the exam is targeted at.

However, be aware that under Java EE 5 there is actually no longer the requirement for a WAR to contain web.xml - although the only 'applications' which won't have web.xml are static ones containing just HTML files and images etc., and probably these are better not in a WAR in the first place. So for all intents and purposes, web.xml is still pretty much mandatory.
 
singh santosh
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi charles,
Thanks for this kind info

regards

-santosh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic