• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

mock example doubt

 
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1 <html>

2 <head><title>A Comment Test</title></head>

3 <body>

4 <h2>A Test of Comments</h2>

5 <!-- This is Html Hidden Comment -->


6 <%-- This is JSP Hidden Comment --%>

7 </body>

8 </html>

this JSP is from the mock exam. The options are

A

Line 5 is inserted in response but Line 6 is not inserted in response
B

Line 5 and Line 6 are inserted in response
C

Both Line 5 and Line 6 are not inserted in response
D

Line 5 is not inserted in response but Line 5 is inserted in response


-The answer is "A". But when I ran this JSP, I got only "A Test of Comments" as a output. Why line 5 is not added in the response?
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
from your explorer's menu,like IE,View-Source,you'll see it
 
dolly shah
Ranch Hand
Posts: 383
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<!-- This is Html Hidden Comment -->

This line is added to the response, but when the clients like IE, Mozilla decide to render this page for the user; they see this HTML comment, and hence it is not displayed in the web page.

Hope this explanation helps.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic