Meaningless Drivel is fun!
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jspInit 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 "jspInit" Watch "jspInit" New topic


shanthisri mocherla
Ranch Hand

Joined: Sep 05, 2005
Posts: 119
Given the following jsp line select the correct statements:
<% public void jspInit() { code...} %>

1) It is a valid line that can be used to initialize the servlet that implements the jsp file.
2) It won't compile as no identifer can start with jsp not _jsp.
3) It will serve as the servlet initialization if the function's name is _jspInit.
4) There is no way to initialize a jsp's implementation class servlet.

can anyone please explain me what the correct answer is?
The correct answer given is 1.

But I think that the methods should be written in JSP declaratons.
Right??? we should use <%! %> instead of <% %>(JSP scriptlet)
[ February 16, 2006: Message edited by: shanthisri mocherla ]
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

You are right. It has already be discussed before. Search for the thread

[My Blog]
All roads lead to JavaRanch
Ranch Hand

Joined: Oct 09, 2003
Posts: 517
Get details from here...

God Gave Me Nothing I Wanted<br />He Gave Me Everything I Needed<br /> - Swami Vivekananda
I agree. Here's the link:
subject: jspInit
It's not a secret anymore!