This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Coffee Cram, Chap 11, Q 7

 
sridhar row
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Which are true? (Choose all that apply.)
A. Lines 10 and 12 are equivalent in any type of JSP page.
B. Line 10 is not valid in a JSP document (XML-based document).
C. Line 11 will properly import the java.util package.
D. Line 12 will properly import the java.util package.
E. Line 13 will properly import the java.util package

Ans given is B and D.

Why is option A not true? Both 10 and 12 should work in kind of Jsp page
[ December 27, 2008: Message edited by: javajamba ]
 
Vishal Chugh
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I think problem with "any type"

A. Lines 10 and 12 are equivalent in "any type" of JSP page.

See 12 will work fine in normal JSP page as well as in XML based JSP document(which is also a JSP page ). But 10 will work fine with normal JSP but wont work in 2nd type of JSP which is XML based.

To be honest , dono how I missed it earlier while doing this question, thanks you asked.

see also:
1 2

[ December 28, 2008: Message edited by: Vishal Chugh ]
[ December 28, 2008: Message edited by: Vishal Chugh ]
 
Ankit V Agrawal
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<jsp irective.page import=�java.util.*� />

is not valid in a jsp PAGE...its only valid in a jsp DOCUMENT
 
Vishal Chugh
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No its valid in JSP , i used it and it was fine
 
sridhar row
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah problem is 'any type of Jsp page'.

In the book HFSJ it says
a normal JSP is a page, unless it�s written with the XML alternatives to normal JSP syntax, in which case it becomes a document.


So option A according to the HFSJ should also be true. Coz JSP page is not the same as JSP document is it?
 
Ankit V Agrawal
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes if you write line 12 the code becomes jsp DOCUMENT and would not be considered a jsp PAGE...and hence option A is not correct
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic