This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jspInit() problem  RSS feed

 
Harshana Dias
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
We know that when JSP translation time in to Servlet we have jspInit() method and Container calles it right? not by any Servlet.

But in HFSJ said that when you implement jspInit() method.."the container calles this method at the begining of this page's life as a servlet.its called from the servlets init() method". Im confused here with the statment.."its called from the servlets init() method".

What if we dont have any servlets in our app?

Thank You.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They're talking about the servlet that's created to implement the JSP, not any servlet that you might write.

You don't have to do anything.
 
Harshana Dias
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:They're talking about the servlet that's created to implement the JSP, not any servlet that you might write.

You don't have to do anything.


First of all Thankx BB

Implement the JSP means like RequestDispatching for a JSP.?

So point is here container is always called the jspInit() even we overide it or not right?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Correct. Your code never calls it.
 
Harshana Dias
Ranch Hand
Posts: 352
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Correct. Your code never calls it.


Im really sorry for disturbed you again. but got this confusion again...

If the JSP is not invoke by a Servlet then those jspInit(), _jspService(), jspDestroy() are called by the container right?

But if the jsp is invoked via a servlet (like RequestDispating) then do those jspInit(), _jspService(), jspDestroy() methods called by that servlet init(), service(),destroy() ?

that is what i understand in the HFSJ 1.5 page 305.

Thank You.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!