| 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: 4725
|
|
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
|
 |
 |
|
|
subject: JSP Documents - 11th hour confusion
|
|
|