Logo F2FInterview

Servlet Interview Questions

Q   |   QA

When we specified method=’GET’ in HTML

Example :

< form name=’SSS’ method=’GET’>

When we specified method=’POST’ in HTML

< form name=’SSS’ method=’POST’ >

GET Method : Using get method we can able to pass 2K data from HTML All data we are passing to Server will be displayed in URL (request string).

POST Method : In this method we does not have any size limitation. All data passed to server will be hidden, User cannot able to see this info
on the browser.

When first request came in for the servlet , Server will invoke init() method of the servlet. There after if any user request the servlet program, Server will directly executes the service() method. When Server want to remove the servlet from pool, then it will execute the destroy() method

Servlet Interface is the central abstraction. All servlets implements this Servlet Interface either direclty or indirectly ( may implement or extend Servlet Interfaces sub classes or sub interfaces)

Servlet
|
Generic Servlet
|
HttpServlet ( Class ) — we will extend this class to handle GET / PUT HTTP requests
|
MyServlet

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: