File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes use get method without displaying on url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "use get method without displaying on url " Watch "use get method without displaying on url " New topic
Author

use get method without displaying on url

sushindranath k
Greenhorn

Joined: Nov 30, 2006
Posts: 6
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

Joined: Nov 29, 2005
Posts: 2308
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();
}


Rahul Bhattacharjee
LinkedIn - Blog
sushindranath k
Greenhorn

Joined: Nov 30, 2006
Posts: 6
Thanks a lot,
and how about the query which is faster doget() or doPost()
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
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

Joined: Mar 22, 2000
Posts: 12678
    
    5
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


Java Resources at www.wbrogden.com
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: use get method without displaying on url
 
Similar Threads
Convert JFrame to image
replacement for applets
Display URL in browser
Java Swing Custom Cursor ( Mac styled rotating dots busy cursor)
how can i open new window browser or Internet Explorer from java Applet