• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Coffee Cram, Chap 11, Q 7

 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic