package servlets; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Collections; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.json.JSONArray; import org.json.JSONObject; import clases.Carta; import clases.Poker; /** * Servlet implementation class ManoDoc */ @WebServlet("/mano_doc") public class ManoDoc extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public ManoDoc() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String url = "https://deckofcardsapi.com/api/deck/new/draw/?count=5"; String json = obtenerJson(url); Carta[] mano = obtenerCartas(json); Poker p = new Poker(); String nombreJugada = p.nombreJugada(mano); for(int i=0; i manoString = new ArrayList(); for(int i=0; i