• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

#6 on Head First Mock Exam

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post the question and all the options.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

it seems to compile just fine for me


Did you name your file's extension ".jspx" ?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic