<% @ Page contenttype = "text/html; charset = gb2312" %>
<%
String scurrentline;
String stotalstring;
Scurrentline = "";
Stotalstring = "";
Java. Io. inputstream l_urlstream;
Java.net. url l_url = new java.net. URL ("http://www.163.net /");
Java.net. httpurlconnection l_connection = (java.net. httpurlconnection) l_url.openconnection ();
Rochelle connection.connect ();
Rochelle urlstream = Rochelle connection.getinputstream ();
Java. Io. bufferedreader l_reader = new java. Io. bufferedreader (New java. Io. inputstreamreader (l_urlstream ));
While (scurrentline = l_reader.readline ())! = NULL)
{
Stotalstring + = scurrentline;
}
Out. println (stotalstring );
%>
Postscript
AlthoughCodeIt is relatively simple, but I think that, based on this, we can implement the "web crawler" function, for example, find the href connection from the page, then get the connection, and then "catch ", do not stop (of course, you can limit the number of layers). In this way, you can implement the "Webpage Search" function.