how to post data to server just like the IE does.
1 posts in topic
Flat View  Flat View

Posted By:   gang_yang
Posted On:   Thursday, May 1, 2003 03:06 AM

this is not only a question for applete, but for client-side.

I want to code a app to send forms to server, just like what the internet explorer does.

Can anyone give me some simple examples to illustrate how the do request and do post methods work to send data to server ??

thank you !

Re: how to post data to server just like the IE does.

Posted By:   Stephen_McConnell  
Posted On:   Thursday, May 1, 2003 05:33 AM

It sounds from the way you worded your qeustion that a short understanding of HTTP protocol seems in order.

Post and Get are actions taken by a browser when you submit a request. Any time you access a web site, you usually start with a Do Get request. You are sending a message to the server to Get a specific piece of content referenced by the URL (web address) that you send it.

When you are writing a web application, one is writing an application that connects to the Web Server so the Web server recognizes the application and directs the request to it. CGI programs written in Perl, Python, C/C++ all connected to the Web Server and had functions which would interpret the request and then pass back information to the Web Server to send out in the Response....

The Java Servlet specification was developed to improve the development of those type of web applications. Instead of launching a new program for each request, a Web Application Server hooked to the Web Server (or provided it's own Web Server) and managed "threads" which processed the Get and Post methods.

Servlets had the methods doPost and doGet which are called by the Web Application Server to process the Post and Get actions. These don't execute on the User's computer, but on the Server that the browser talks to.

Applets (which is the forum where you posted this query) do not usually handle Get and Post actions, since they execute on the Client (browser side) of the Client/Server process.

I would suggest getting some books on Servlets and/or JSP's to understand the entire process. I always recomment Jason Hunter's book Java Servlet Programming if you have a background in Java. It covers Servlets, JSP's and web applications in general. It has a very good overview of the HTTP protocol and has LOTS of examples.

Hope this helps

Stephen McConnell

About | Sitemap | Contact