Skip to content

Instantly share code, notes, and snippets.

@vik-y
Created May 19, 2015 07:23
Show Gist options
  • Save vik-y/472b3253cbfa67f133f6 to your computer and use it in GitHub Desktop.
Save vik-y/472b3253cbfa67f133f6 to your computer and use it in GitHub Desktop.
IBM first assignment JSP
<%@ 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