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 jspService,jspInit and jspDestory !! 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 "jspService,jspInit and jspDestory !!" Watch "jspService,jspInit and jspDestory !!" New topic

jspService,jspInit and jspDestory !!

Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
_jspService(HttpServletRequest, HttpServletResponse) is mandatorily inserted into the servlet resulting from the JSP
But the jspInit() and jspDestroy( ) are optionally inserted depending on whether or not they are defined in the JSP.
(this is said in whizlabs)

Is this statement true ?

If yes, i.e. if we dont override them in our JSP, who defines these methods ( JspPage is a interface, and HttpJspPage too is a interface, so
who defines these methods )

If No,again, who provides there imlementation ? is it the container that provides it by saying this -

i mean the org.apache,jasper.runtime.HttJspPage provides the implementaion of jspInit( ) jspDestroy( ) and _jspService( )
of the JspPage and HttpJsp interfaces, but then the class says ',jasper.runtime.JspSourceDependent'
instead of saying ',jasper.runtime.HttpJspInterface' !

Any help in this direction will help
Thanks in advance !

SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
Niranjan Deshpande
Ranch Hand

Joined: Oct 16, 2005
Posts: 1277
i was expecting some replies !!!
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
Cool down, dude.

As far as Im aware of, when a Jsp page is turn into the so called page implementation class, this generated class got to be implementing the interface javax.servlet.jsp.HttpJspPage (which is extended from JspPage).

JspPage interface defines the method jspInit and jspDestroy, while HttpJspPage define one additional method _jspService.

Web container such as Tomcat, WAS or etc, usually provides a base page class that all Jsp page implementation class will be extended from, for various reasons such as optimization and extra container services.

If you provides your own jspInit or jspDestroy in your jsp page, this means that you are overriding the implementation of the base class, which I think it's not a so good idea. Well, it's still container specific.

Hope this help. Cheers

SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: jspService,jspInit and jspDestory !!
It's not a secret anymore!