diff --git b/.classpath a/.classpath new file mode 100644 index 0000000..cf7b07f --- /dev/null +++ a/.classpath @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git b/.gitignore a/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ a/.gitignore @@ -0,0 +1 @@ +/build/ diff --git b/.project a/.project new file mode 100644 index 0000000..a2603ea --- /dev/null +++ a/.project @@ -0,0 +1,31 @@ + + + jweb-e002 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + + diff --git b/.settings/.jsdtscope a/.settings/.jsdtscope new file mode 100644 index 0000000..92e666d --- /dev/null +++ a/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git b/.settings/org.eclipse.jdt.core.prefs a/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ a/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git b/.settings/org.eclipse.wst.common.component a/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..3d6e5f1 --- /dev/null +++ a/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ + + + + + + + + diff --git b/.settings/org.eclipse.wst.common.project.facet.core.xml a/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..01f950a --- /dev/null +++ a/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git b/.settings/org.eclipse.wst.jsdt.ui.superType.container a/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ a/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git b/.settings/org.eclipse.wst.jsdt.ui.superType.name a/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ a/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git b/WebContent/ConversorResultado.jsp a/WebContent/ConversorResultado.jsp new file mode 100644 index 0000000..a8de86a --- /dev/null +++ a/WebContent/ConversorResultado.jsp @@ -0,0 +1,86 @@ +<%@page import="java.util.ArrayList"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Resultado Conversor + + + +<% ArrayListresultado=(ArrayList) request.getAttribute("resultado"); + + +String tipo =request.getAttribute("P0").toString(); +if(tipo.toLowerCase().equals("c")){ + tipo="° Celsius"; +}else if(tipo.toLowerCase().equals("f")){ + tipo="° Fahrenheit"; +}else{ + tipo="° Kelvin"; +} +%> + + + + +
+ +
+
+ +
+ +
+
+ +
+ + " required disabled> +
+ +
+ +
+ "> +
+
+
+ +
+ "> +
+
+
+ +
+ "> +
+
+ + \ No newline at end of file diff --git b/WebContent/META-INF/MANIFEST.MF a/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ a/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git b/WebContent/ResultadoCarta.jsp a/WebContent/ResultadoCarta.jsp new file mode 100644 index 0000000..338ce27 --- /dev/null +++ a/WebContent/ResultadoCarta.jsp @@ -0,0 +1,38 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + + +Resultado Carta + + + + " width=200 height=250 > + + \ No newline at end of file diff --git b/WebContent/agenda.html a/WebContent/agenda.html new file mode 100644 index 0000000..c16ad73 --- /dev/null +++ a/WebContent/agenda.html @@ -0,0 +1,35 @@ + + + + +Agenda + + + + + + \ No newline at end of file diff --git b/WebContent/cartas.html a/WebContent/cartas.html new file mode 100644 index 0000000..da29bbd --- /dev/null +++ a/WebContent/cartas.html @@ -0,0 +1,65 @@ + + + + +Cartas + + + + +
+
+
+
+
+
+ +
+ +
+
+ +
+ + +
+ +
+ +
+ + +
+
+ + \ No newline at end of file diff --git b/WebContent/conversor.html a/WebContent/conversor.html new file mode 100644 index 0000000..8bc9dd5 --- /dev/null +++ a/WebContent/conversor.html @@ -0,0 +1,67 @@ + + + + + + Conversor + + + + + +
+
+
+
+
+
+ +
+ +
+
+ +
+ + +
+ +
+ +
+ + +
+
+ + + \ No newline at end of file diff --git b/WebContent/imagenes/2C.png a/WebContent/imagenes/2C.png new file mode 100644 index 0000000..413b0da Binary files /dev/null and a/WebContent/imagenes/2C.png differ diff --git b/WebContent/imagenes/2D.png a/WebContent/imagenes/2D.png new file mode 100644 index 0000000..f966e48 Binary files /dev/null and a/WebContent/imagenes/2D.png differ diff --git b/WebContent/imagenes/2H.png a/WebContent/imagenes/2H.png new file mode 100644 index 0000000..345744e Binary files /dev/null and a/WebContent/imagenes/2H.png differ diff --git b/WebContent/imagenes/2S.png a/WebContent/imagenes/2S.png new file mode 100644 index 0000000..a0de145 Binary files /dev/null and a/WebContent/imagenes/2S.png differ diff --git b/WebContent/imagenes/3C.png a/WebContent/imagenes/3C.png new file mode 100644 index 0000000..f8b8183 Binary files /dev/null and a/WebContent/imagenes/3C.png differ diff --git b/WebContent/imagenes/3D.png a/WebContent/imagenes/3D.png new file mode 100644 index 0000000..cee21f3 Binary files /dev/null and a/WebContent/imagenes/3D.png differ diff --git b/WebContent/imagenes/3H.png a/WebContent/imagenes/3H.png new file mode 100644 index 0000000..8494e1c Binary files /dev/null and a/WebContent/imagenes/3H.png differ diff --git b/WebContent/imagenes/3S.png a/WebContent/imagenes/3S.png new file mode 100644 index 0000000..78e3b20 Binary files /dev/null and a/WebContent/imagenes/3S.png differ diff --git b/WebContent/imagenes/4C.png a/WebContent/imagenes/4C.png new file mode 100644 index 0000000..8938459 Binary files /dev/null and a/WebContent/imagenes/4C.png differ diff --git b/WebContent/imagenes/4D.png a/WebContent/imagenes/4D.png new file mode 100644 index 0000000..d9ae5be Binary files /dev/null and a/WebContent/imagenes/4D.png differ diff --git b/WebContent/imagenes/4H.png a/WebContent/imagenes/4H.png new file mode 100644 index 0000000..41a4488 Binary files /dev/null and a/WebContent/imagenes/4H.png differ diff --git b/WebContent/imagenes/4S.png a/WebContent/imagenes/4S.png new file mode 100644 index 0000000..70bc9cc Binary files /dev/null and a/WebContent/imagenes/4S.png differ diff --git b/WebContent/imagenes/5C.png a/WebContent/imagenes/5C.png new file mode 100644 index 0000000..a7f49be Binary files /dev/null and a/WebContent/imagenes/5C.png differ diff --git b/WebContent/imagenes/5D.png a/WebContent/imagenes/5D.png new file mode 100644 index 0000000..cff0617 Binary files /dev/null and a/WebContent/imagenes/5D.png differ diff --git b/WebContent/imagenes/5H.png a/WebContent/imagenes/5H.png new file mode 100644 index 0000000..1efcbf3 Binary files /dev/null and a/WebContent/imagenes/5H.png differ diff --git b/WebContent/imagenes/5S.png a/WebContent/imagenes/5S.png new file mode 100644 index 0000000..e708806 Binary files /dev/null and a/WebContent/imagenes/5S.png differ diff --git b/WebContent/imagenes/6C.png a/WebContent/imagenes/6C.png new file mode 100644 index 0000000..d8382d3 Binary files /dev/null and a/WebContent/imagenes/6C.png differ diff --git b/WebContent/imagenes/6D.png a/WebContent/imagenes/6D.png new file mode 100644 index 0000000..7ba40e9 Binary files /dev/null and a/WebContent/imagenes/6D.png differ diff --git b/WebContent/imagenes/6H.png a/WebContent/imagenes/6H.png new file mode 100644 index 0000000..93a84f8 Binary files /dev/null and a/WebContent/imagenes/6H.png differ diff --git b/WebContent/imagenes/6S.png a/WebContent/imagenes/6S.png new file mode 100644 index 0000000..874162b Binary files /dev/null and a/WebContent/imagenes/6S.png differ diff --git b/WebContent/imagenes/7C.png a/WebContent/imagenes/7C.png new file mode 100644 index 0000000..f6a9653 Binary files /dev/null and a/WebContent/imagenes/7C.png differ diff --git b/WebContent/imagenes/7D.png a/WebContent/imagenes/7D.png new file mode 100644 index 0000000..6c4393d Binary files /dev/null and a/WebContent/imagenes/7D.png differ diff --git b/WebContent/imagenes/7H.png a/WebContent/imagenes/7H.png new file mode 100644 index 0000000..d4a59ff Binary files /dev/null and a/WebContent/imagenes/7H.png differ diff --git b/WebContent/imagenes/7S.png a/WebContent/imagenes/7S.png new file mode 100644 index 0000000..895f85c Binary files /dev/null and a/WebContent/imagenes/7S.png differ diff --git b/WebContent/imagenes/8C.png a/WebContent/imagenes/8C.png new file mode 100644 index 0000000..bc87bf0 Binary files /dev/null and a/WebContent/imagenes/8C.png differ diff --git b/WebContent/imagenes/8D.png a/WebContent/imagenes/8D.png new file mode 100644 index 0000000..38c5695 Binary files /dev/null and a/WebContent/imagenes/8D.png differ diff --git b/WebContent/imagenes/8H.png a/WebContent/imagenes/8H.png new file mode 100644 index 0000000..c2812aa Binary files /dev/null and a/WebContent/imagenes/8H.png differ diff --git b/WebContent/imagenes/8S.png a/WebContent/imagenes/8S.png new file mode 100644 index 0000000..0277cc6 Binary files /dev/null and a/WebContent/imagenes/8S.png differ diff --git b/WebContent/imagenes/9C.png a/WebContent/imagenes/9C.png new file mode 100644 index 0000000..d81b2f2 Binary files /dev/null and a/WebContent/imagenes/9C.png differ diff --git b/WebContent/imagenes/9D.png a/WebContent/imagenes/9D.png new file mode 100644 index 0000000..e0d3d05 Binary files /dev/null and a/WebContent/imagenes/9D.png differ diff --git b/WebContent/imagenes/9H.png a/WebContent/imagenes/9H.png new file mode 100644 index 0000000..7b679e1 Binary files /dev/null and a/WebContent/imagenes/9H.png differ diff --git b/WebContent/imagenes/9S.png a/WebContent/imagenes/9S.png new file mode 100644 index 0000000..f58493e Binary files /dev/null and a/WebContent/imagenes/9S.png differ diff --git b/WebContent/imagenes/AC.png a/WebContent/imagenes/AC.png new file mode 100644 index 0000000..396c158 Binary files /dev/null and a/WebContent/imagenes/AC.png differ diff --git b/WebContent/imagenes/AD.png a/WebContent/imagenes/AD.png new file mode 100644 index 0000000..d702a39 Binary files /dev/null and a/WebContent/imagenes/AD.png differ diff --git b/WebContent/imagenes/AH.png a/WebContent/imagenes/AH.png new file mode 100644 index 0000000..435fc14 Binary files /dev/null and a/WebContent/imagenes/AH.png differ diff --git b/WebContent/imagenes/AS.png a/WebContent/imagenes/AS.png new file mode 100644 index 0000000..f07f67d Binary files /dev/null and a/WebContent/imagenes/AS.png differ diff --git b/WebContent/imagenes/JC.png a/WebContent/imagenes/JC.png new file mode 100644 index 0000000..16418e4 Binary files /dev/null and a/WebContent/imagenes/JC.png differ diff --git b/WebContent/imagenes/JD.png a/WebContent/imagenes/JD.png new file mode 100644 index 0000000..05b0389 Binary files /dev/null and a/WebContent/imagenes/JD.png differ diff --git b/WebContent/imagenes/JH.png a/WebContent/imagenes/JH.png new file mode 100644 index 0000000..259421c Binary files /dev/null and a/WebContent/imagenes/JH.png differ diff --git b/WebContent/imagenes/JS.png a/WebContent/imagenes/JS.png new file mode 100644 index 0000000..6e0554d Binary files /dev/null and a/WebContent/imagenes/JS.png differ diff --git b/WebContent/imagenes/KC.png a/WebContent/imagenes/KC.png new file mode 100644 index 0000000..70c4ee5 Binary files /dev/null and a/WebContent/imagenes/KC.png differ diff --git b/WebContent/imagenes/KD.png a/WebContent/imagenes/KD.png new file mode 100644 index 0000000..95a3b8f Binary files /dev/null and a/WebContent/imagenes/KD.png differ diff --git b/WebContent/imagenes/KH.png a/WebContent/imagenes/KH.png new file mode 100644 index 0000000..0defcbb Binary files /dev/null and a/WebContent/imagenes/KH.png differ diff --git b/WebContent/imagenes/KS.png a/WebContent/imagenes/KS.png new file mode 100644 index 0000000..43b8e19 Binary files /dev/null and a/WebContent/imagenes/KS.png differ diff --git b/WebContent/imagenes/QC.png a/WebContent/imagenes/QC.png new file mode 100644 index 0000000..6f74177 Binary files /dev/null and a/WebContent/imagenes/QC.png differ diff --git b/WebContent/imagenes/QD.png a/WebContent/imagenes/QD.png new file mode 100644 index 0000000..85c443f Binary files /dev/null and a/WebContent/imagenes/QD.png differ diff --git b/WebContent/imagenes/QH.png a/WebContent/imagenes/QH.png new file mode 100644 index 0000000..ba8e1e4 Binary files /dev/null and a/WebContent/imagenes/QH.png differ diff --git b/WebContent/imagenes/QS.png a/WebContent/imagenes/QS.png new file mode 100644 index 0000000..a6ef69f Binary files /dev/null and a/WebContent/imagenes/QS.png differ diff --git b/WebContent/imagenes/TC.png a/WebContent/imagenes/TC.png new file mode 100644 index 0000000..f9ade6d Binary files /dev/null and a/WebContent/imagenes/TC.png differ diff --git b/WebContent/imagenes/TD.png a/WebContent/imagenes/TD.png new file mode 100644 index 0000000..a9de67e Binary files /dev/null and a/WebContent/imagenes/TD.png differ diff --git b/WebContent/imagenes/TH.png a/WebContent/imagenes/TH.png new file mode 100644 index 0000000..df551b0 Binary files /dev/null and a/WebContent/imagenes/TH.png differ diff --git b/WebContent/imagenes/TS.png a/WebContent/imagenes/TS.png new file mode 100644 index 0000000..22141df Binary files /dev/null and a/WebContent/imagenes/TS.png differ diff --git b/WebContent/index.html a/WebContent/index.html new file mode 100644 index 0000000..de86a36 --- /dev/null +++ a/WebContent/index.html @@ -0,0 +1,37 @@ + + + + +Inicio + + + + + + + + \ No newline at end of file diff --git b/src/servlet/Carta.java a/src/servlet/Carta.java new file mode 100644 index 0000000..41b669b --- /dev/null +++ a/src/servlet/Carta.java @@ -0,0 +1,54 @@ +package servlet; + +import java.io.IOException; + +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; + +/** + * Servlet implementation class Carta + */ +@WebServlet("/dibujo_carta") +public class Carta extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public Carta() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + //response.getWriter().append("Served at: ").append(request.getContextPath()); + + String palo = request.getParameter("P0").toUpperCase(); + String valor = request.getParameter("P1").toUpperCase(); + + String rutaImagen = "imagenes/"+valor+palo+".png"; + System.out.println(rutaImagen); + + request.setAttribute("rutaImagen", rutaImagen); + + RequestDispatcher rd = getServletContext().getRequestDispatcher("/ResultadoCarta.jsp"); + rd.forward(request, response); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + doGet(request, response); + } + +} diff --git b/src/servlet/ConversorServlet.java a/src/servlet/ConversorServlet.java new file mode 100644 index 0000000..57fd749 --- /dev/null +++ a/src/servlet/ConversorServlet.java @@ -0,0 +1,101 @@ +package servlet; + +import java.io.IOException; +import java.util.ArrayList; + +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; + +/** + * Servlet implementation class ConversorServlet + */ +@WebServlet("/ConversorServlet") +public class ConversorServlet extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public ConversorServlet() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + response.getWriter().append("Served at: ").append(request.getContextPath()); + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + // TODO Auto-generated method stub + doGet(request, response); + + System.out.println(request.getParameter("P0").toString()); + System.out.println(Float.parseFloat(request.getParameter("P1"))); + try { + ArrayListresultado = convertidor(request.getParameter("P0").toString(),Float.parseFloat(request.getParameter("P1"))); + System.out.println("aca llego"); + request.setAttribute("P0", request.getParameter("P0")); + request.setAttribute("P1", request.getParameter("P")); + request.setAttribute("resultado", resultado); + } catch (Exception e) { + // TODO: handle exception + + RequestDispatcher rd = request.getRequestDispatcher("Error.jsp"); + if (rd != null) { + rd.forward(request, response); + } + } + + RequestDispatcher rd = request.getRequestDispatcher("/ConversorResultado.jsp"); + if (rd != null) { + rd.forward(request, response); + } + } + + + protected ArrayList convertidor(String tipo_temperatura, Float temperatura) { + ArrayList resultado= new ArrayList(); + resultado.add((float) 0); + resultado.add((float) 0); + resultado.add((float) 0); + if(tipo_temperatura.toLowerCase().equals("c") ) { + resultado.clear(); + resultado.add(temperatura); + resultado.add((float) ((temperatura * 9/5) + 32)); + resultado.add((float) (temperatura + 273.15)); + } + if(tipo_temperatura.toLowerCase().equals("f")) { + + resultado.clear(); + resultado.add((float)((temperatura - 32) * 5/9)); + resultado.add(temperatura); + resultado.add((float)((temperatura - 32) * 5/9 + 273.15 )); + + } + if(tipo_temperatura.toLowerCase().equals("k")) { + resultado.clear(); + resultado.add((float)(temperatura - 273.15)); + resultado.add((float)((temperatura - 273.15) * 9/5 + 32)); + resultado.add(temperatura); + } + for(Float item: resultado) { + System.out.println("asdasdasd"); + System.out.println(item); + } + return resultado; + } + + + +}