Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Can we override JspServiece() ? if not why?  RSS feed

Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Every One !!!111

is jspserviece() iverloaded or not ? if not explain clearly.
who will take care about class file generation, recompialtion of servlet for jsp s

Thanks in Advice
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Bhavya
Yees,we can override the _jspservice method.For overridding the
jspService method , we have extends the currend Jsp page with our
own class .This class must be extended by org.apache.jasper.runtime.HttpJspBase for Tomcat version, for Othe server you have to check the class.
Insert the following code in ur JSP Page
<%@ page extends="name of ur class"%>

And write class as follows
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.*;
import org.apache.jasper.runtime.HttpJspBase;

//public class OwnJSp implements HttpJspPage
public class OwnJSp extends org.apache.jasper.runtime.HttpJspBase

public void _jspService(javax.servlet.http.HttpServletRequest request,javax.servlet.http.HttpServletResponse response)throws javax.servlet.ServletException,

and provide the implementation for _jspService method which cna handle
HTTp methods
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!