Find jobs | Jobseekers
Employer login
About us Sitemap of www.CareerRide.com Sitemap FAQ related with www.CareerRide.com FAQ Click here to Contact us Contact
       
Submit Resume Free ! | Access Resume Free !
Home Career Services Resume Services Interview questions Articles Books
Content
Java interview part 1
Java interview part 2
Java interview part 3
Java interview part 4
Java interview part 5
Core java
JDBC
JSP
EJB
JNI
Servlets
Struts
Java threading
Java web services
J2EE
J2ME
JMS
Internationalization
JavaScript
RMI
 
ASP.NET | ADO.NET | AJAX
C#.NET | VB.NET | PHP
NET Remoting | NET Interview
  
C | C++ | Java | Oops
Data Structure | OS
   
Database concepts | Oracle
SQL Server | Biztalk | Sharepoint
Notification services
Reporting Services
Service-oriented architecture
Data warehousing | MySQL
  
Project Management 
Linux | Testing | Networking
Software engineering 
  
UML | XML | HTML | SOAP 
CSS | VBScript  | Web Services
   
CV Cover letter | Interview 
HR | Soft skills | GD 
Working from Home 
Tutorial
ASP.NET | VB.NET | C#.NET     
Remoting.NET | Web service
Remoting overview | ADO.NET
UML | Sql server 
More links
JavaServer Faces 
OpenCms Application Overview 
EJB 3 Entities 
Oracle Web RowSet 
Books on Java
Java EE 5 Development with NetBeans 6 
OpenCms 7 Development 
EJB 3 Developer Guide 
JDBC 4.0 and Oracle JDeveloper for J2EE Development 

Servlet - doGet() and doPost()


What is the difference between difference between doGet() and doPost()?

Answer
doGet() and doPost() are HTTP requests handled by servlet classes.

  • In doGet(), the parameters are appended to the URL and sent along with header information. This does not happen in case of doPost(). In doPost(), the parameters are sent separately.
  • Since most of the web servers support only a limited amount of information to be attached to the headers, the size of this header should not exceed 1024 bytes. doPost() does not have this constraint.

Usually programmers find it difficult to choose between doGet() and doPost().

  • doGet() shall be used when small amount of data and insensitive data like a query has to be sent as a request.
  • doPost() shall be used when comparatively large amount of sensitive data has to be sent. Examples are sending data after filling up a form or sending login id and password.

Following example would help in understand the working of the doGet() and doPost() better:

When you type the word ‘java’ in google search bar and hit enter, this is what you will find in the address bar:

http://www.google.co.in/search?hl=en&q=java&meta=
This is an example of doGet().

Had it been doPost(), you wouldn’t have been able tosee“hl=en&q=java&meta=” in the address bar.


NEXT>>

More Servlets links

List out the difference between a JavaBean from a Servlet?

Answer - Servlets are Java based analog to CGI programs, implemented by means of ..........

Explain how servlets differ from RMI. Explain the advantages and disadvantages of each technology.

Answer - RMI (Remote Method Invocation) are a means of client server communication........

Define servlet mapping.

Answer - Servlet mapping controls how you access a servlet. It is recommended that you don’t use.........

 
Today's Hot Jobs
C++  SQL Server
.NET  Java  Oracle
Finance  Marketing
Seekers  Employers
Copyright © 2008 CareerRide.com. All rights reserved.