0

Currently i'm using JSTL tag to get the URL from third party API. for this i have added the standard-1.0.6.jar in the classpath. I used tomcat server.

I would like to know how this really works technically. Which HTTP client is used by c:import? whether there is separate http client for JSTL built inside standard.jar, or will it use http client used by tomcat server?

If i need to access the internet to get the same third party API using a internet proxy server, which part of HTTP client i need to modify (in standard.jar for any jstl http client or in tomcat httpclient)?

BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452
Satheesh
  • 693
  • 1
  • 8
  • 27

1 Answers1

0

It's just using the standard Java SE URLConnection class. You can use it in plain Java as follows:

URLConnection connection = new URL("http://stackoverflow.com").openConnection();
InputStream input = connection.getInputStream();
// ...

Or by the URL#openStream() shortcut:

InputStream input = new URL("http://stackoverflow.com").openStream();
// ...

The InputStream contains the HTTP response. Just read/write it to an arbitrary OutputStream the usual way.

See also:

Community
  • 1
  • 1
BalusC
  • 992,635
  • 352
  • 3,478
  • 3,452