Code Monkey home page Code Monkey logo

java-servlets's Introduction

Java-Servlets

A Servlet an application that runs in a Web server or application server and provides server-side processing such as accessing a database. Servlet can be created either by implementing Servlet Interface or extending abstract classe (GenericServlet or HttpServlet)

Server Client

Getting Started

These instructions will help you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Eclipse IDE
  • Java 1.7+ Version

Deployment

Clone this repository and run each examples.

Servlet Terminology

  • Http (Hypertext Transfer Protocol): It's a stateless request-response based communication protocol.
  • Client: A Client is any machine that requests information.
  • Webserver: Web Server takes client Request and send requested resource back to the Client.
  • Servlet: It is a small Java program runs within a Web Server (usually across Http).
  • Web Container: Runtime environment for Servlets, manages life cycle of servlet.

Methods

Methods Description
public void init(ServletConfig config) initializes the servlet. It is the life cycle method of servlet and invoked by the web container only once.
public void service(ServletRequest request,ServletResponse response) provides response for the incoming request. It is invoked at each request by the web container.
public void destroy() is invoked only once and indicates that servlet is being destroyed.
public ServletConfig getServletConfig() returns the object of ServletConfig
public String getServletInfo() returns information about servlet such as writer, copyright, version etc.

Servlet API

javax.servlet

Interfaces

  • RequestDispatcher
  • Servlet
  • ServletConfig
  • ServletContext
  • ServletRequest
  • ServletResponse
  • SingleThreadModel

Classes

  • GenericServlet
  • ServletInputStream
  • ServletOutputStream

Exception Classes

  • ServletException
  • UnavailableException

javax.servlet.http

Interfaces

  • HttpServletRequest
  • HttpServletResponse
  • HttpSession
  • HttpSessionBindingListener
  • HttpSessionContext

Classes

  • Cookie
  • HttpServlet
  • HttpSessionBindingEvent
  • HttpUtils

Examples

This repository explains following examples:

Authors

  • Suneet Patil

License

This project is licensed under the MIT License - see the LICENSE file for details

java-servlets's People

Contributors

lesliecorrea avatar suneetpatil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ebyaug007

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.