• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock Exam Question doubt(j2eecertificate)

 
gopal venu
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.Which of the following statements will have the same output in a JSP page? [Select all correct answers]
1<jsp:getProperty name="webSite" property="url" />
2<% webSite.getUrl() %>
3<%= webSite.getUrl() %>
4<%= webSite.url %>
5<%= webSite.getUrl(); %>

Answers 1 and 3 are correct.
I feel 1 and 2 are correc if 2 is like <% webSite.getUrl(); %>
because <jsp:getProperty> is not printing to print writer.as in 3.

Q19.
Which of the following statements are correct about the web-application deployment descriptor? [Select all correct answers]
1The deployment descriptor can be called web.xml, but the name of the file is case-sensitive.
2The deployment descriptor must be placed under the META-INF directory of your web-application.
3The deployment descriptor must be placed under the WEB-INF directory of your web-application.
4The order of the XML elements must be respected in the web.xml file.
5The deployment descriptor defines how your web-application is deployed in the servlet-container.

Answers 3 and 4 are correct.
My Answers 1,3,4

Exam Explanation: Answer 1 is incorrect, the deployment descriptor must be called web.xml, this name is case-sensitive.
Answer 2 is incorrect, the web.xml must be placed under the WEB-INF directory.
The deployment descriptor describes and defines the behaviour of your web-application,
it contains the configuration of your web-application and is a well-formed XML document
specified by the web application deployment descriptor DTD.


What you guys say about these two questions???
 
John Pearson
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the first question, 1 and 3 are correct, because <jsp:getProperty> does print out the result. It gets the requested property, converts it to a String, and sends it to the implicit out object, so it will have the same effect as 3.

On the second question, I'd agree that with you that 1 should be a correct answer.
 
Jan Sterk
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Q19.4: The Servlet Specs 2.4 state that 'sub-elements under web-app can be in an arbitrary order in this version of the specs.' (p.106, 3rd bullit)

So answer 4 is wrong.
 
Jan Sterk
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Why is 19.5 wrong?
 
Gunnar Maluf
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jan Sterk:


Why is 19.5 wrong?


I think the 19.5 means that the web.xml does not define *where* phisically your deployment should happen. It defines the configuration of your web app and not the deployment itself.

regards,
Gunnar
 
Amol Fuke
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
19.5 is wrong because web.xml is not case-sensitive.I tried WEB.xml and it works in weblogic.

Thanks,
Amol
 
Jan Sterk
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Amol Fuke:
19.5 is wrong because web.xml is not case-sensitive.I tried WEB.xml and it works in weblogic.

Thanks,
Amol


Do you mean 19.1?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic