aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question 43) 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 "Question 43)" Watch "Question 43)" New topic
Author

Question 43)

Timber Lee
Ranch Hand

Joined: Oct 14, 2002
Posts: 157
Which jsp lines are correct?
1) <%! String myString=”Hello” %>
2) <% String myString=request.getServerName() %>
3) <%= out.print(“Hello” %>
4) <%= “Hello” %>
author's answer is only 4) . do you think so?


SCJP<br />SCWCD<br />SCEA
g madhava
Ranch Hand

Joined: Sep 14, 2001
Posts: 85
1)<%! String myString=”Hello” %>
It needs to have a ; at the end like this
<%! String myString=”Hello”; %>
2) <% String myString=request.getServerName() %>
Same as above the ; is missing
3) <%= out.print(“Hello” %>
<%= means out.print so esssentially
it would be
out.print(out.print("Hello"));
which is not the way how it should be...
4) <%= “Hello” %>
This is the correct one as given by the author.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question 43)