• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use get method without displaying on url

 
sushindranath k
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,


How can i use get method without displaying the information on url and
which is faster doGet() or doPost().

Regards
sushi
[ December 14, 2006: Message edited by: Bear Bibeault ]
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sushindranath kkkk:
hi all,


How can i use get method without displaying the information on url and
which is faster doGet() or doPost().




You can send the information in the body of the request using POST and then

doPost(){
doGet();
}
 
sushindranath k
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot,
and how about the query which is faster doget() or doPost()
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing to do with speed.What kind of information you are planning to pass from the client to the servlet.If that is small and non criticle , then go for GET or else POST.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets review what happens when a servlet gets a request.
1. Before your service method gets called, the servlet container constructs a request object and a response object. The request object is populated with the HTTP headers parsed out of the request. We are talking lots of String operations here, with all header lines parsed and placed in a Map.This is time consuming.

2. Your service method (the one inherited from DefaultServlet) looks at the method - GET or POST or whatever and calls your custom doPost or doGet with those request and response objects.

How much time do you think this one string comparison takes compared to all that parsing?

Bill
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sushindranath kkkk
Welcome to JavaRanch!

We're pleased to have you here with us in the Servlets forum, but there
are a few rules that need to be followed, and one is that proper names are
required. Please take a look at the
JavaRanch Naming Policy and
adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sushindranath k,

Thank you for taking the time to update your screen name.
Unfortunately you have changed it to one that is also invalid.

Initals are allowed for first names but not for last names.
Please use the same link (above) to go back and fix your last name.

-Ben
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic