This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ Chapter 7 Page 341 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ Chapter 7 Page 341" Watch "HFSJ Chapter 7 Page 341" New topic

HFSJ Chapter 7 Page 341

Suhas Wadadekar
Ranch Hand

Joined: May 16, 2006
Posts: 95
The explanation to Question 15 says,

"Options A and D are invalid because only Java statements may be included within <% .... %> tags"

Option D <% import java.util.Date; %> looks pretty much correct Java syntax to me. I must agree I was confused by this answer choice and even confused by the answer/explanation.

Ankit Garg

Joined: Aug 03, 2008
Posts: 9405

Everything between the <% and %> goes inside the service method of the converted servlet of the JSP. So if you write <% import java.util.Date; %>, it will look like

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Suhas Wadadekar
Ranch Hand

Joined: May 16, 2006
Posts: 95
Makes sense Ankit. Thanks for pointing that out. I was definitely not paying attention to what I was reading.
Have you checked out Aspose?
subject: HFSJ Chapter 7 Page 341
It's not a secret anymore!