0% found this document useful (0 votes)
35 views

If Anyone Wants To Provide Support For Servlet and JSP, Then Need To Implement Servletapi

This document discusses interface definitions and requirements for developing Java web application servers and database drivers. It notes that interfaces like ServletAPI and JDBC API specify requirements that servers and drivers must implement, such as defining methods that must be public and abstract. This allows different servers and drivers to be developed while maintaining compatibility with Java web and database applications.

Uploaded by

Zishan Ahamed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

If Anyone Wants To Provide Support For Servlet and JSP, Then Need To Implement Servletapi

This document discusses interface definitions and requirements for developing Java web application servers and database drivers. It notes that interfaces like ServletAPI and JDBC API specify requirements that servers and drivers must implement, such as defining methods that must be public and abstract. This allows different servers and drivers to be developed while maintaining compatibility with Java web and database applications.

Uploaded by

Zishan Ahamed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Interface Definition

1. Any service requirement specification.


2. Any contract between client and service provider.
After learn core, java then you have learned advanced java like JSP Servlet. If you want to run java based web application
then compulsory need web server.
Tomcat, web logic, oracle http is an example of server. By using tomcat we happily can run java application and same by
others. But how others also work as same like tomcat?
Yes, every server follows same service requirement or same interface like ServletAPI.
If anyone wants to provide support for Servlet and JSP, then need to implement ServletAPI.
Suppose tomorrow I want to develop ZishanWebServer to run java based web application, so to develop this web server
then which method I need to implement, which classes I required to develop this server?
All these information are available to ServletAPI.

For java application to connect with database their needs something like API/software component which called driver.
To develop this driver software, the requirement specification found from JDBC API. This API implemented by MySQL
driver, oracle driver.

www.facebook.com/liar.zishan
Every methods present in interface is always public and abstract by default. When implemented then method should
be public in child class.

What are the errors in above first program?


1. Abstract method should be override in child class, so public modifier must be specified as by default interface
methods are public abstract.
2. Child class should implement all abstract method of parent class, at least one.
3. If any method still not clears then skip this in child class by declaring child class as abstract. Rest of method then
should be implemented in next child class.

Notes:
1. In interface method by default public abstract and child class responsible for implementation using public
modifier
2. In interface by default data member is final static. So you need to give value. And u accesses this by its own
method from next child implementation.
3. Interface can extend other interfaces.
www.facebook.com/liar.zishan
4. If same method signature found in several interfaces then child class only once implement this method.
5. Interface static method can be called directly by interface name dot.
6. No constructor allowed in interface but allowed in abstract class.
7. Static and final allowed only for data members and by default all date members are static final. But in abstract
no restriction.

www.facebook.com/liar.zishan

You might also like