File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jspService,jspInit and jspDestory !!

 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
_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 '....org.apache,jasper.runtime.JspSourceDependent'
instead of saying '....org.apache,jasper.runtime.HttpJspInterface' !

Any help in this direction will help
Thanks in advance !
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was expecting some replies !!!
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic