fsockopen equivalent in JSP

前端 未结 3 1140
离开以前
离开以前 2021-01-16 09:15

How do i go about converting this code to JSP

Any help appreciated..!

$fp = fsockopen(\"www.example.com\", 80, $errno, $errstr, 30);
if (!$fp) {
             


        
3条回答
  •  我在风中等你
    2021-01-16 09:29

    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:

    
    

提交回复
热议问题