wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Difference between jspInit and _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 "Difference between jspInit and _jspInit" Watch "Difference between jspInit and _jspInit" New topic
Author

Difference between jspInit and _jspInit

Swapnil Suryakant Prabhavalkar
Greenhorn

Joined: Feb 25, 2012
Posts: 23

Hi Ranchers,

What is the exact difference between jspinit and _jspInit?

I searched it on google and found the answers like :
1. After translating jsp into servlet, jspInit gets converted to _jspInit
2. _jspInit is only created when we use custom tags in JSP

But when I saw the source code of org.apache.jasper.runtime.HttpJspbase, there are calls to both jpInit and _jspInit from init method?

Could you please help me in understanding in this? thanks in advance.

Oracle Certified Professional, Java SE 6 Programmer (81%), Oracle Certified Expert, Java EE 6 Web Component Developer (87%)
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4922
    
  10

You can override jspInit-method and _jspInit-method (just like any other method starting with _) can't be overridden.


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Swapnil Suryakant Prabhavalkar
Greenhorn

Joined: Feb 25, 2012
Posts: 23

Thanks Roel.

But I want to know what is the basic difference between them? Why those separate methods exist?

Cheers,
Swapnil
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 4922
    
  10

Maybe this thread could help you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between jspInit and _jspInit
 
Similar Threads
Eduardo Cobian's mock question 4
jspInit ....
Mock Exam Question
Cobins Exam Very complectaed
jsp question