Created
May 19, 2015 07:23
-
-
Save vik-y/472b3253cbfa67f133f6 to your computer and use it in GitHub Desktop.
IBM first assignment JSP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ page language="java" contentType="text/html; charset=UTF-8" | |
pageEncoding="UTF-8"%> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Insert title here</title> | |
</head> | |
<body> | |
<%@page import="java.io.*" %> | |
<%@page import="java.net.*" %> | |
<% | |
String recv; | |
String recvbuff = ""; | |
URL jsonpage = new URL("http://graph.facebook.com/vikas.yadav.in"); | |
URLConnection urlcon = jsonpage.openConnection(); | |
BufferedReader buffread = new BufferedReader(new InputStreamReader(urlcon.getInputStream())); | |
while ((recv = buffread.readLine()) != null) | |
recvbuff += recv; | |
buffread.close(); | |
out.println(recvbuff); | |
%> | |
<hr> | |
Hello <b><%= request.getParameter("name") %></b>! | |
Welcome | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment