File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Initialization for a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Initialization for a JSP" Watch "Initialization for a JSP" New topic

Initialization for a JSP

Parth Twari
Ranch Hand

Joined: Jan 20, 2010
Posts: 163
I wanted to share this question I have tested:

Which are possible locations for code to perform initialization for a JSP?

A. In the jspInit() method.
B. In the init(ServletConfig) method.
C. In the constructor of the JSP's Java code.
D. In a JSP declaration which includes an initializer block.
E. In the init() method
F. in static initializer block

From what i have tested answers will be: A,D,E, F

here is the code if you want to test it

I hope it will help others.

Parth Tiwari
| Pursuing Bachelor of Engineering | OSUM Club Leader | SCJP 6 | SCWCD 5 |...
Ankit Garg

Joined: Aug 03, 2008
Posts: 9466

Parth please tell us the source of the question...

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Parth Twari
Ranch Hand

Joined: Jan 20, 2010
Posts: 163
I have read the question in many mock exams. Most recently I read it in SAI mock exam
I agree. Here's the link:
subject: Initialization for a JSP
It's not a secret anymore!