From 122c52ea0bb8fb69bdfe4b19cd44abe62681370f Mon Sep 17 00:00:00 2001 From: Cristian Date: Tue, 20 Aug 2019 17:03:39 -0400 Subject: [PATCH] inicial --- .classpath | 17 +++++++++++++++++ .gitignore | 1 + .project | 31 +++++++++++++++++++++++++++++++ .settings/.jsdtscope | 12 ++++++++++++ .settings/org.eclipse.jdt.core.prefs | 7 +++++++ .settings/org.eclipse.wst.common.component | 8 ++++++++ .settings/org.eclipse.wst.common.project.facet.core.xml | 10 ++++++++++ .settings/org.eclipse.wst.jsdt.ui.superType.container | 1 + .settings/org.eclipse.wst.jsdt.ui.superType.name | 1 + WebContent/ConversorResultado.jsp | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ WebContent/META-INF/MANIFEST.MF | 3 +++ WebContent/ResultadoCarta.jsp | 38 ++++++++++++++++++++++++++++++++++++++ WebContent/agenda.html | 35 +++++++++++++++++++++++++++++++++++ WebContent/cartas.html | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ WebContent/conversor.html | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ WebContent/imagenes/2C.png | Bin 0 -> 18838 bytes WebContent/imagenes/2D.png | Bin 0 -> 17076 bytes WebContent/imagenes/2H.png | Bin 0 -> 17622 bytes WebContent/imagenes/2S.png | Bin 0 -> 16701 bytes WebContent/imagenes/3C.png | Bin 0 -> 22549 bytes WebContent/imagenes/3D.png | Bin 0 -> 20104 bytes WebContent/imagenes/3H.png | Bin 0 -> 20545 bytes WebContent/imagenes/3S.png | Bin 0 -> 19245 bytes WebContent/imagenes/4C.png | Bin 0 -> 23683 bytes WebContent/imagenes/4D.png | Bin 0 -> 18843 bytes WebContent/imagenes/4H.png | Bin 0 -> 19891 bytes WebContent/imagenes/4S.png | Bin 0 -> 18763 bytes WebContent/imagenes/5C.png | Bin 0 -> 27723 bytes WebContent/imagenes/5D.png | Bin 0 -> 21817 bytes WebContent/imagenes/5H.png | Bin 0 -> 23556 bytes WebContent/imagenes/5S.png | Bin 0 -> 21622 bytes WebContent/imagenes/6C.png | Bin 0 -> 30178 bytes WebContent/imagenes/6D.png | Bin 0 -> 25532 bytes WebContent/imagenes/6H.png | Bin 0 -> 26545 bytes WebContent/imagenes/6S.png | Bin 0 -> 24177 bytes WebContent/imagenes/7C.png | Bin 0 -> 31786 bytes WebContent/imagenes/7D.png | Bin 0 -> 25423 bytes WebContent/imagenes/7H.png | Bin 0 -> 26122 bytes WebContent/imagenes/7S.png | Bin 0 -> 24072 bytes WebContent/imagenes/8C.png | Bin 0 -> 36725 bytes WebContent/imagenes/8D.png | Bin 0 -> 29912 bytes WebContent/imagenes/8H.png | Bin 0 -> 29440 bytes WebContent/imagenes/8S.png | Bin 0 -> 29511 bytes WebContent/imagenes/9C.png | Bin 0 -> 38146 bytes WebContent/imagenes/9D.png | Bin 0 -> 30872 bytes WebContent/imagenes/9H.png | Bin 0 -> 30083 bytes WebContent/imagenes/9S.png | Bin 0 -> 30148 bytes WebContent/imagenes/AC.png | Bin 0 -> 16295 bytes WebContent/imagenes/AD.png | Bin 0 -> 15560 bytes WebContent/imagenes/AH.png | Bin 0 -> 16131 bytes WebContent/imagenes/AS.png | Bin 0 -> 28393 bytes WebContent/imagenes/JC.png | Bin 0 -> 178358 bytes WebContent/imagenes/JD.png | Bin 0 -> 182390 bytes WebContent/imagenes/JH.png | Bin 0 -> 186608 bytes WebContent/imagenes/JS.png | Bin 0 -> 182767 bytes WebContent/imagenes/KC.png | Bin 0 -> 161344 bytes WebContent/imagenes/KD.png | Bin 0 -> 171628 bytes WebContent/imagenes/KH.png | Bin 0 -> 183915 bytes WebContent/imagenes/KS.png | Bin 0 -> 179903 bytes WebContent/imagenes/QC.png | Bin 0 -> 183556 bytes WebContent/imagenes/QD.png | Bin 0 -> 187118 bytes WebContent/imagenes/QH.png | Bin 0 -> 194245 bytes WebContent/imagenes/QS.png | Bin 0 -> 163468 bytes WebContent/imagenes/TC.png | Bin 0 -> 39304 bytes WebContent/imagenes/TD.png | Bin 0 -> 30498 bytes WebContent/imagenes/TH.png | Bin 0 -> 29863 bytes WebContent/imagenes/TS.png | Bin 0 -> 30184 bytes WebContent/index.html | 37 +++++++++++++++++++++++++++++++++++++ src/servlet/Carta.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/servlet/ConversorServlet.java | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 70 files changed, 574 insertions(+) create mode 100644 .classpath create mode 100644 .gitignore create mode 100644 .project create mode 100644 .settings/.jsdtscope create mode 100644 .settings/org.eclipse.jdt.core.prefs create mode 100644 .settings/org.eclipse.wst.common.component create mode 100644 .settings/org.eclipse.wst.common.project.facet.core.xml create mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.container create mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.name create mode 100644 WebContent/ConversorResultado.jsp create mode 100644 WebContent/META-INF/MANIFEST.MF create mode 100644 WebContent/ResultadoCarta.jsp create mode 100644 WebContent/agenda.html create mode 100644 WebContent/cartas.html create mode 100644 WebContent/conversor.html create mode 100644 WebContent/imagenes/2C.png create mode 100644 WebContent/imagenes/2D.png create mode 100644 WebContent/imagenes/2H.png create mode 100644 WebContent/imagenes/2S.png create mode 100644 WebContent/imagenes/3C.png create mode 100644 WebContent/imagenes/3D.png create mode 100644 WebContent/imagenes/3H.png create mode 100644 WebContent/imagenes/3S.png create mode 100644 WebContent/imagenes/4C.png create mode 100644 WebContent/imagenes/4D.png create mode 100644 WebContent/imagenes/4H.png create mode 100644 WebContent/imagenes/4S.png create mode 100644 WebContent/imagenes/5C.png create mode 100644 WebContent/imagenes/5D.png create mode 100644 WebContent/imagenes/5H.png create mode 100644 WebContent/imagenes/5S.png create mode 100644 WebContent/imagenes/6C.png create mode 100644 WebContent/imagenes/6D.png create mode 100644 WebContent/imagenes/6H.png create mode 100644 WebContent/imagenes/6S.png create mode 100644 WebContent/imagenes/7C.png create mode 100644 WebContent/imagenes/7D.png create mode 100644 WebContent/imagenes/7H.png create mode 100644 WebContent/imagenes/7S.png create mode 100644 WebContent/imagenes/8C.png create mode 100644 WebContent/imagenes/8D.png create mode 100644 WebContent/imagenes/8H.png create mode 100644 WebContent/imagenes/8S.png create mode 100644 WebContent/imagenes/9C.png create mode 100644 WebContent/imagenes/9D.png create mode 100644 WebContent/imagenes/9H.png create mode 100644 WebContent/imagenes/9S.png create mode 100644 WebContent/imagenes/AC.png create mode 100644 WebContent/imagenes/AD.png create mode 100644 WebContent/imagenes/AH.png create mode 100644 WebContent/imagenes/AS.png create mode 100644 WebContent/imagenes/JC.png create mode 100644 WebContent/imagenes/JD.png create mode 100644 WebContent/imagenes/JH.png create mode 100644 WebContent/imagenes/JS.png create mode 100644 WebContent/imagenes/KC.png create mode 100644 WebContent/imagenes/KD.png create mode 100644 WebContent/imagenes/KH.png create mode 100644 WebContent/imagenes/KS.png create mode 100644 WebContent/imagenes/QC.png create mode 100644 WebContent/imagenes/QD.png create mode 100644 WebContent/imagenes/QH.png create mode 100644 WebContent/imagenes/QS.png create mode 100644 WebContent/imagenes/TC.png create mode 100644 WebContent/imagenes/TD.png create mode 100644 WebContent/imagenes/TH.png create mode 100644 WebContent/imagenes/TS.png create mode 100644 WebContent/index.html create mode 100644 src/servlet/Carta.java create mode 100644 src/servlet/ConversorServlet.java diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..cf7b07f --- /dev/null +++ b/.classpath @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/.project b/.project new file mode 100644 index 0000000..a2603ea --- /dev/null +++ b/.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 a/.settings/.jsdtscope b/.settings/.jsdtscope new file mode 100644 index 0000000..92e666d --- /dev/null +++ b/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/.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 a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..3d6e5f1 --- /dev/null +++ b/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..01f950a --- /dev/null +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/.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 a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/WebContent/ConversorResultado.jsp b/WebContent/ConversorResultado.jsp new file mode 100644 index 0000000..a8de86a --- /dev/null +++ b/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 a/WebContent/META-INF/MANIFEST.MF b/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..254272e --- /dev/null +++ b/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/WebContent/ResultadoCarta.jsp b/WebContent/ResultadoCarta.jsp new file mode 100644 index 0000000..338ce27 --- /dev/null +++ b/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 a/WebContent/agenda.html b/WebContent/agenda.html new file mode 100644 index 0000000..c16ad73 --- /dev/null +++ b/WebContent/agenda.html @@ -0,0 +1,35 @@ + + + + +Agenda + + + + + + \ No newline at end of file diff --git a/WebContent/cartas.html b/WebContent/cartas.html new file mode 100644 index 0000000..da29bbd --- /dev/null +++ b/WebContent/cartas.html @@ -0,0 +1,65 @@ + + + + +Cartas + + + + +
+
+
+
+
+
+ +
+ +
+
+ +
+ + +
+ +
+ +
+ + +
+
+ + \ No newline at end of file diff --git a/WebContent/conversor.html b/WebContent/conversor.html new file mode 100644 index 0000000..8bc9dd5 --- /dev/null +++ b/WebContent/conversor.html @@ -0,0 +1,67 @@ + + + + + + Conversor + + + + + +
+
+
+
+
+
+ +
+ +
+
+ +
+ + +
+ +
+ +
+ + +
+
+ + + \ No newline at end of file diff --git a/WebContent/imagenes/2C.png b/WebContent/imagenes/2C.png new file mode 100644 index 0000000..413b0da Binary files /dev/null and b/WebContent/imagenes/2C.png differ diff --git a/WebContent/imagenes/2D.png b/WebContent/imagenes/2D.png new file mode 100644 index 0000000..f966e48 Binary files /dev/null and b/WebContent/imagenes/2D.png differ diff --git a/WebContent/imagenes/2H.png b/WebContent/imagenes/2H.png new file mode 100644 index 0000000..345744e Binary files /dev/null and b/WebContent/imagenes/2H.png differ diff --git a/WebContent/imagenes/2S.png b/WebContent/imagenes/2S.png new file mode 100644 index 0000000..a0de145 Binary files /dev/null and b/WebContent/imagenes/2S.png differ diff --git a/WebContent/imagenes/3C.png b/WebContent/imagenes/3C.png new file mode 100644 index 0000000..f8b8183 Binary files /dev/null and b/WebContent/imagenes/3C.png differ diff --git a/WebContent/imagenes/3D.png b/WebContent/imagenes/3D.png new file mode 100644 index 0000000..cee21f3 Binary files /dev/null and b/WebContent/imagenes/3D.png differ diff --git a/WebContent/imagenes/3H.png b/WebContent/imagenes/3H.png new file mode 100644 index 0000000..8494e1c Binary files /dev/null and b/WebContent/imagenes/3H.png differ diff --git a/WebContent/imagenes/3S.png b/WebContent/imagenes/3S.png new file mode 100644 index 0000000..78e3b20 Binary files /dev/null and b/WebContent/imagenes/3S.png differ diff --git a/WebContent/imagenes/4C.png b/WebContent/imagenes/4C.png new file mode 100644 index 0000000..8938459 Binary files /dev/null and b/WebContent/imagenes/4C.png differ diff --git a/WebContent/imagenes/4D.png b/WebContent/imagenes/4D.png new file mode 100644 index 0000000..d9ae5be Binary files /dev/null and b/WebContent/imagenes/4D.png differ diff --git a/WebContent/imagenes/4H.png b/WebContent/imagenes/4H.png new file mode 100644 index 0000000..41a4488 Binary files /dev/null and b/WebContent/imagenes/4H.png differ diff --git a/WebContent/imagenes/4S.png b/WebContent/imagenes/4S.png new file mode 100644 index 0000000..70bc9cc Binary files /dev/null and b/WebContent/imagenes/4S.png differ diff --git a/WebContent/imagenes/5C.png b/WebContent/imagenes/5C.png new file mode 100644 index 0000000..a7f49be Binary files /dev/null and b/WebContent/imagenes/5C.png differ diff --git a/WebContent/imagenes/5D.png b/WebContent/imagenes/5D.png new file mode 100644 index 0000000..cff0617 Binary files /dev/null and b/WebContent/imagenes/5D.png differ diff --git a/WebContent/imagenes/5H.png b/WebContent/imagenes/5H.png new file mode 100644 index 0000000..1efcbf3 Binary files /dev/null and b/WebContent/imagenes/5H.png differ diff --git a/WebContent/imagenes/5S.png b/WebContent/imagenes/5S.png new file mode 100644 index 0000000..e708806 Binary files /dev/null and b/WebContent/imagenes/5S.png differ diff --git a/WebContent/imagenes/6C.png b/WebContent/imagenes/6C.png new file mode 100644 index 0000000..d8382d3 Binary files /dev/null and b/WebContent/imagenes/6C.png differ diff --git a/WebContent/imagenes/6D.png b/WebContent/imagenes/6D.png new file mode 100644 index 0000000..7ba40e9 Binary files /dev/null and b/WebContent/imagenes/6D.png differ diff --git a/WebContent/imagenes/6H.png b/WebContent/imagenes/6H.png new file mode 100644 index 0000000..93a84f8 Binary files /dev/null and b/WebContent/imagenes/6H.png differ diff --git a/WebContent/imagenes/6S.png b/WebContent/imagenes/6S.png new file mode 100644 index 0000000..874162b Binary files /dev/null and b/WebContent/imagenes/6S.png differ diff --git a/WebContent/imagenes/7C.png b/WebContent/imagenes/7C.png new file mode 100644 index 0000000..f6a9653 Binary files /dev/null and b/WebContent/imagenes/7C.png differ diff --git a/WebContent/imagenes/7D.png b/WebContent/imagenes/7D.png new file mode 100644 index 0000000..6c4393d Binary files /dev/null and b/WebContent/imagenes/7D.png differ diff --git a/WebContent/imagenes/7H.png b/WebContent/imagenes/7H.png new file mode 100644 index 0000000..d4a59ff Binary files /dev/null and b/WebContent/imagenes/7H.png differ diff --git a/WebContent/imagenes/7S.png b/WebContent/imagenes/7S.png new file mode 100644 index 0000000..895f85c Binary files /dev/null and b/WebContent/imagenes/7S.png differ diff --git a/WebContent/imagenes/8C.png b/WebContent/imagenes/8C.png new file mode 100644 index 0000000..bc87bf0 Binary files /dev/null and b/WebContent/imagenes/8C.png differ diff --git a/WebContent/imagenes/8D.png b/WebContent/imagenes/8D.png new file mode 100644 index 0000000..38c5695 Binary files /dev/null and b/WebContent/imagenes/8D.png differ diff --git a/WebContent/imagenes/8H.png b/WebContent/imagenes/8H.png new file mode 100644 index 0000000..c2812aa Binary files /dev/null and b/WebContent/imagenes/8H.png differ diff --git a/WebContent/imagenes/8S.png b/WebContent/imagenes/8S.png new file mode 100644 index 0000000..0277cc6 Binary files /dev/null and b/WebContent/imagenes/8S.png differ diff --git a/WebContent/imagenes/9C.png b/WebContent/imagenes/9C.png new file mode 100644 index 0000000..d81b2f2 Binary files /dev/null and b/WebContent/imagenes/9C.png differ diff --git a/WebContent/imagenes/9D.png b/WebContent/imagenes/9D.png new file mode 100644 index 0000000..e0d3d05 Binary files /dev/null and b/WebContent/imagenes/9D.png differ diff --git a/WebContent/imagenes/9H.png b/WebContent/imagenes/9H.png new file mode 100644 index 0000000..7b679e1 Binary files /dev/null and b/WebContent/imagenes/9H.png differ diff --git a/WebContent/imagenes/9S.png b/WebContent/imagenes/9S.png new file mode 100644 index 0000000..f58493e Binary files /dev/null and b/WebContent/imagenes/9S.png differ diff --git a/WebContent/imagenes/AC.png b/WebContent/imagenes/AC.png new file mode 100644 index 0000000..396c158 Binary files /dev/null and b/WebContent/imagenes/AC.png differ diff --git a/WebContent/imagenes/AD.png b/WebContent/imagenes/AD.png new file mode 100644 index 0000000..d702a39 Binary files /dev/null and b/WebContent/imagenes/AD.png differ diff --git a/WebContent/imagenes/AH.png b/WebContent/imagenes/AH.png new file mode 100644 index 0000000..435fc14 Binary files /dev/null and b/WebContent/imagenes/AH.png differ diff --git a/WebContent/imagenes/AS.png b/WebContent/imagenes/AS.png new file mode 100644 index 0000000..f07f67d Binary files /dev/null and b/WebContent/imagenes/AS.png differ diff --git a/WebContent/imagenes/JC.png b/WebContent/imagenes/JC.png new file mode 100644 index 0000000..16418e4 Binary files /dev/null and b/WebContent/imagenes/JC.png differ diff --git a/WebContent/imagenes/JD.png b/WebContent/imagenes/JD.png new file mode 100644 index 0000000..05b0389 Binary files /dev/null and b/WebContent/imagenes/JD.png differ diff --git a/WebContent/imagenes/JH.png b/WebContent/imagenes/JH.png new file mode 100644 index 0000000..259421c Binary files /dev/null and b/WebContent/imagenes/JH.png differ diff --git a/WebContent/imagenes/JS.png b/WebContent/imagenes/JS.png new file mode 100644 index 0000000..6e0554d Binary files /dev/null and b/WebContent/imagenes/JS.png differ diff --git a/WebContent/imagenes/KC.png b/WebContent/imagenes/KC.png new file mode 100644 index 0000000..70c4ee5 Binary files /dev/null and b/WebContent/imagenes/KC.png differ diff --git a/WebContent/imagenes/KD.png b/WebContent/imagenes/KD.png new file mode 100644 index 0000000..95a3b8f Binary files /dev/null and b/WebContent/imagenes/KD.png differ diff --git a/WebContent/imagenes/KH.png b/WebContent/imagenes/KH.png new file mode 100644 index 0000000..0defcbb Binary files /dev/null and b/WebContent/imagenes/KH.png differ diff --git a/WebContent/imagenes/KS.png b/WebContent/imagenes/KS.png new file mode 100644 index 0000000..43b8e19 Binary files /dev/null and b/WebContent/imagenes/KS.png differ diff --git a/WebContent/imagenes/QC.png b/WebContent/imagenes/QC.png new file mode 100644 index 0000000..6f74177 Binary files /dev/null and b/WebContent/imagenes/QC.png differ diff --git a/WebContent/imagenes/QD.png b/WebContent/imagenes/QD.png new file mode 100644 index 0000000..85c443f Binary files /dev/null and b/WebContent/imagenes/QD.png differ diff --git a/WebContent/imagenes/QH.png b/WebContent/imagenes/QH.png new file mode 100644 index 0000000..ba8e1e4 Binary files /dev/null and b/WebContent/imagenes/QH.png differ diff --git a/WebContent/imagenes/QS.png b/WebContent/imagenes/QS.png new file mode 100644 index 0000000..a6ef69f Binary files /dev/null and b/WebContent/imagenes/QS.png differ diff --git a/WebContent/imagenes/TC.png b/WebContent/imagenes/TC.png new file mode 100644 index 0000000..f9ade6d Binary files /dev/null and b/WebContent/imagenes/TC.png differ diff --git a/WebContent/imagenes/TD.png b/WebContent/imagenes/TD.png new file mode 100644 index 0000000..a9de67e Binary files /dev/null and b/WebContent/imagenes/TD.png differ diff --git a/WebContent/imagenes/TH.png b/WebContent/imagenes/TH.png new file mode 100644 index 0000000..df551b0 Binary files /dev/null and b/WebContent/imagenes/TH.png differ diff --git a/WebContent/imagenes/TS.png b/WebContent/imagenes/TS.png new file mode 100644 index 0000000..22141df Binary files /dev/null and b/WebContent/imagenes/TS.png differ diff --git a/WebContent/index.html b/WebContent/index.html new file mode 100644 index 0000000..de86a36 --- /dev/null +++ b/WebContent/index.html @@ -0,0 +1,37 @@ + + + + +Inicio + + + + + + + + \ No newline at end of file diff --git a/src/servlet/Carta.java b/src/servlet/Carta.java new file mode 100644 index 0000000..41b669b --- /dev/null +++ b/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 a/src/servlet/ConversorServlet.java b/src/servlet/ConversorServlet.java new file mode 100644 index 0000000..57fd749 --- /dev/null +++ b/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; + } + + + +} -- libgit2 0.26.0