2 Steps to jsp send post request and print response data



Yesterday, my boss asked me to write a program demo to get data at other website.His need is: if we use url:http://www.***.com/coord.php?coord=51.00, coord.php page will send a post request to website: http://www.***.com to and get ,print data.

From need, i know i should program a jsp demo, this functions are:

1.JSP page should send a post request to other website

2.JSP page should get response data and echo it.

To realize this need, we can do as follow:

Step 1: Create a jsp file

We can use eclipse to create a jsp file,meanwhile, you should make sure your created jsp file can be executed in your program, which means you should have a tomcat+jdk environment.