This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes JSP Documents - 11th hour confusion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "JSP Documents - 11th hour confusion" Watch "JSP Documents - 11th hour confusion" New topic
Author

JSP Documents - 11th hour confusion

Patrick Williams
Ranch Hand

Joined: Apr 03, 2005
Posts: 213
Hello Everyone, On page 597 of HFSJ, it states that "There is more you have to know if you write this by hand - the whole document, for example, must be enclosed in a <jsp:root> tag (which includes some other stuff), and the taglib directives go inside the <jsp:root> opening tag, rather than as a <jsp:directive>.

On pg 763 & 801, Q6 of the final mock exam, You are asked which choices about a JSP document are correct (and choose all that apply).

A: A JSP document must have a <jsp:root> as its top element.

B: The following would be valid as the first line of a JSP document: <jsp:root xmlns:uri="http://java.sun.com/JSP/Page" version="2.0">.

I wont list all of the choices in the spirit of "not giving the book away for free", but I am not sure why A or B are incorrect answers. can someone please explain? Thanks.

[ March 10, 2006: Message edited by: Patrick Williams ]

[ March 10, 2006: Message edited by: Patrick Williams ]
[ March 10, 2006: Message edited by: Patrick Williams ]

Patrick<br /> <br />SCJP/SCWCD/SCBCD/SCDJWS/SCEA<br /> <br />Currently working on:<br />SCJP 6
Daniel Dalton
Ranch Hand

Joined: Mar 20, 2005
Posts: 146
Take a look at Sun's J2EE tutorial:

Creating a JSP Document

I'm definitely not claiming to be an expert, but if you look at their examples (especially the standard JSP converted to a JSP Document), it's clear that you are NOT required to have jsp:root as the top element.

Anyway - hope that gives you a start on it.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Daniel is right. Page 597 is in error (you should submit it to the errata).

The mock exam is correct. For further confirmation, see this:
http://www.onjava.com/pub/a/onjava/2004/04/21/JSP2part3.html


A good workman is known by his tools.
Ravi Appana
Greenhorn

Joined: Aug 25, 2004
Posts: 13
Can someone explain why this option is wrong in the JSP Document:

B: The following would be valid as the first line of a JSP document: <jsp:root xmlns:uri="http://java.sun.com/JSP/Page" version="2.0">

The jsp prefix must always be bound to the JSP namespace: http://java.sun.com/JSP/Page

But, Is it an error to bound the JSP namespace "http://java.sun.com/JSP/Page" with a different prefix. Is the above option wrong, because of using the prefix "uri".


Ravi Sankar Appana<br />SCJP 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP Documents - 11th hour confusion
 
Similar Threads
Examulator mock exam doubts
Cleared SCWCD with 88%
A little competition
#6 on Head First Mock Exam
Well Formed