• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

#6 on Head First Mock Exam

 
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?
 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the question and all the options.
 
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 ]
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • 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" ?
 
This guy is skipping without a rope. At least, that's what this tiny ad said:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic