fsockopen equivalent in JSP
How do i go about converting this code to JSP Any help appreciated..! $fp = fsockopen("www.example.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET / HTTP/1.1\r\n"; $out .= "Host: www.example.com\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); while (!feof($fp)) { echo fgets($fp, 128); } fclose($fp); } You can use the JSTL taglib for this. First declare the namespace at the top of the jsp using <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> And then use the c:import tag to include content from the specified url: <c