• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Chapter 7 Page 341

 
Suhas Wadadekar
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks,
Suhas
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Suhas Wadadekar
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Makes sense Ankit. Thanks for pointing that out. I was definitely not paying attention to what I was reading.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic