@@ -19,11 +19,93 @@ protected void doGet(HttpServletRequest request,
19
19
20
20
// send HTML page to client
21
21
out .println ("<html>" );
22
- out .println ("<head><title>Ejemplo HTML desde Servlet</title></head>" );
22
+ out .println ("<head><title>Ejemplo HTML desde Servlet</title>" );
23
+ out .println ("<style>" );
24
+ out .println ("body {\n " +
25
+ " display: flex;\n " +
26
+ " justify-content: center;\n " +
27
+ " align-items: center;\n " +
28
+ " min-height: 100vh;\n " +
29
+ " background: #eceffc;\n " +
30
+ "}\n " +
31
+ "\n " +
32
+ ".btn {\n " +
33
+ " padding: 8px 20px;\n " +
34
+ " border-radius: 0;\n " +
35
+ " overflow: hidden;\n " +
36
+ "\n " +
37
+ " &::before {\n " +
38
+ " position: absolute;\n " +
39
+ " content: \" \" ;\n " +
40
+ " top: 0;\n " +
41
+ " left: 0;\n " +
42
+ " width: 100%;\n " +
43
+ " height: 100%;\n " +
44
+ " background: linear-gradient(\n " +
45
+ " 120deg,\n " +
46
+ " transparent,\n " +
47
+ " var(--primary-color),\n " +
48
+ " transparent\n " +
49
+ " );\n " +
50
+ " transform: translateX(-100%);\n " +
51
+ " transition: 0.6s;\n " +
52
+ " }\n " +
53
+ "\n " +
54
+ " &:hover {\n " +
55
+ " background: transparent;\n " +
56
+ " box-shadow: 0 0 20px 10px hsla(204, 70%, 53%, 0.5);\n " +
57
+ "\n " +
58
+ " &::before {\n " +
59
+ " transform: translateX(100%);\n " +
60
+ " }\n " +
61
+ " }\n " +
62
+ "}\n " +
63
+ "\n " +
64
+ ".form-input-material {\n " +
65
+ " --input-default-border-color: white;\n " +
66
+ " --input-border-bottom-color: white;\n " +
67
+ " \n " +
68
+ " input {\n " +
69
+ " color: white;\n " +
70
+ " }\n " +
71
+ "}\n " +
72
+ "\n " +
73
+ ".login-form {\n " +
74
+ " display: flex;\n " +
75
+ " flex-direction: column;\n " +
76
+ " align-items: center;\n " +
77
+ " padding: 50px 40px;\n " +
78
+ " color: white;\n " +
79
+ " background: rgba(0, 0, 0, 0.8);\n " +
80
+ " border-radius: 10px;\n " +
81
+ " box-shadow: 0 0.4px 0.4px rgba(128, 128, 128, 0.109),\n " +
82
+ " 0 1px 1px rgba(128, 128, 128, 0.155),\n " +
83
+ " 0 2.1px 2.1px rgba(128, 128, 128, 0.195),\n " +
84
+ " 0 4.4px 4.4px rgba(128, 128, 128, 0.241),\n " +
85
+ " 0 12px 12px rgba(128, 128, 128, 0.35);\n " +
86
+ "\n " +
87
+ " h1 {\n " +
88
+ " margin: 0 0 24px 0;\n " +
89
+ " }\n " +
90
+ "\n " +
91
+ " .form-input-material {\n " +
92
+ " margin: 12px 0;\n " +
93
+ " }\n " +
94
+ "\n " +
95
+ " .btn {\n " +
96
+ " width: 100%;\n " +
97
+ " margin: 18px 0 9px 0;\n " +
98
+ " }\n " +
99
+ "}\n " );
100
+ out .println ("</style>" );
101
+ out .println ("</head" );
23
102
out .println ("<body>" );
24
103
out .println ("<h1>Ejemplo Servlet</h1>" );
25
- out .println ("<p>Este es un ejemplo en el curso de Java para generar HTML desde un Servlet.</p>" );
26
- out .println ("<p><a href=\" /myServlet2\" >Vamos al otro Servlet</a></p>" );
104
+ out .println ("<form action=\" /myServlet2\" >\n " +
105
+ " <label for=\" fname\" >Nombre:</label><br>\n " +
106
+ " <input type=\" text\" id=\" fname\" name=\" fname\" value=\" John\" ><br>\n " +
107
+ " <input type=\" submit\" value=\" Submit\" >\n " +
108
+ "</form> " );
27
109
out .println ("</body></html>" );
28
110
}
29
111
0 commit comments