<%@ page import = "java.io.*,java.util.*,java.net.http.*,java.net.URI,java.net.http.HttpResponse.BodyHandlers,java.net.HttpURLConnection,java.net.URL,java.nio.charset.StandardCharsets,org.json.*" %> <%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %> debug B_04 <%@ page buffer="8192kb" autoFlush="true" %> <% String titleId = request.getParameter("titleId") == null ? "" : request.getParameter("titleId"); String targetURL = "http://127.0.0.1:8082/getTitle?titleId=" + titleId; %> <% StringBuilder res = new StringBuilder(); try { URL url = new URL(targetURL); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); int responseCode = connection.getResponseCode(); BufferedReader reader; if (responseCode == HttpURLConnection.HTTP_OK) { reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); } else { reader = new BufferedReader(new InputStreamReader(connection.getErrorStream())); } String line; while ((line = reader.readLine()) != null) { res.append(line); } reader.close(); } catch (Exception e) { e.printStackTrace(); res.append("Error: ").append(e.getMessage()); } String games = res.toString(); //Tmd size stuff String tmdUrl = "http://198.62.122.200/ccs/download/" + titleId + "/tmd"; StringBuilder tmdRes = new StringBuilder(); long tmdSize = 0; try { URL url = new URL(tmdUrl); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("GET"); tmdSize = connection.getContentLengthLong(); int responseCode = connection.getResponseCode(); BufferedReader reader; if (responseCode == HttpURLConnection.HTTP_OK) { reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); } else { reader = new BufferedReader(new InputStreamReader(connection.getErrorStream())); } String line; //String contentLength = connection.getHeaderField("Content-Length"); //tmdSize = contentLength; while ((line = reader.readLine()) != null) { tmdRes.append(line); } reader.close(); } catch (Exception e) { //e.printStacktrace(out); res.append("Error: ").append(e.getMessage()); } %> <% // Parse JSON response JSONObject title = new JSONObject(games); String id = title.getString("id").replace("00010002", "00010001"); String thumbnail = title.getString("thumbnail"); String title1 = title.getString("title1"); String title2 = title.getString("title2"); String platform = title.getString("console"); if (platform.equals("WII")) { platform = "Wii Channels"; } else if (platform.equals("WIIWARE")) { platform = "WiiWare"; }; String releaseDate = title.getString("date"); String genre = title.getString("genre"); String publisher = title.getString("publisher"); String points = title.getString("points"); String players = title.getString("players"); String ratingDetails = title.getString("ratingdetails"); String rating = title.getString("rating").toUpperCase(); String controllers = title.getString("controllers"); String size = title.getString("size"); String latestVersion = title.getString("titleVersion"); %> Details
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・                   ・・
・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・・
Wii Points
Details
To customers who downloaded the Internet Channel
for 500 Wii Points:

In accordance with the Internet Channel
becoming free of charge, you can now download one
NES title (worth 500 Wii Points) free of charge.
Please note that this offer will expire
on December 31st, 2009.
<%= genre %>
Released <%= releaseDate %>
<%= publisher %>
<%= players %>
<%= title1 %>
<%= title2 %>
<%= platform %>
<% if (!rating.equals("")) { %> ESRBE <% } %>
<%= ratingDetails %>
Free
<%= points %> Wii Points
Gift
0 Wii Points