This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Is it possible for jsp to extend a servlet? I have following scenario:
I have a servlet which initialises some static objects in its init method. All my servlets extend this servlet to access those variables. I have few JSPs which also require same static objects. So is it possible to extend those JSP to my parent servlet and read those variables?
Hai Vikas, There is some problem when the jsp extends Servlet, when you invoke the jsp from browser it will execute only the service of the extended servlet, it wont render anything that you have given in jsp file. [ October 13, 2006: Message edited by: Balasubramani Dharmalingam ]
Joined: Jun 22, 2001
Ok, That's a big problem. In that case I will have to make a common jsp and in that jsp's jspInit() I will have to reinitialise all objects. The inlude that common jsp in to all jsps at complie time. Will that work? [ October 13, 2006: Message edited by: Vikas Aggarwal ]