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

#6 on Head First Mock Exam

 
Michael Sampson
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My apollogies if this has been asked before and I did do a brief search...On the mock exam provided here:
http://www.headfirstlabs.com/books/hfsvlt/HFServlets_Mock_Exam_1st_Ed.pdf
On question 6 they have e. as an incorrect response. When you scroll down to see the explanation it reads "only <jsp eclaration> syntax is valid." I am now confused because I am looking at a JSP I used <%! %> to declare a member variable and it seems to compile just fine for me. Where is my misunderstanding?
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the question and all the options.
 
Ander Rodriguez
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The question says:

Which about JSP Documents (XML-based documents) are true?
(Choose all that apply.)


And the standar <%! %> is a valid declaration in a JSP, but not in a JSP Document. JSP Document is a well-formed XML document.

<jsp:root>
<jsp:declaration>
<jsp:expression>
<jsp:directive.page>
<jsp:text>

etc...

in this case, it is not valid <%! %>

I hope this help you.

Bye
[ November 13, 2008: Message edited by: Ander Rodriguez ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it seems to compile just fine for me

Did you name your file's extension ".jspx" ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic