Changes by universidad

parent cfa5cba7
...@@ -2,10 +2,22 @@ package com.example.demo; ...@@ -2,10 +2,22 @@ package com.example.demo;
import static spark.Spark.*; import static spark.Spark.*;
import java.util.HashMap;
import java.util.Map;
import spark.ModelAndView;
import spark.*;
public class AppConfig { public class AppConfig {
public static void main(String[] args) { public static void main(String[] args) {
get("/hello", (req, res) -> "Hello World"); get("/hello", (req, res) -> "Respeto");
get("/hello", (req, res) -> {
String nombre = req.queryParams("nombre");
Map<String, Object> modelo = new HashMap<>();
modelo.put("nombre", nombre);
return new ModelAndView(modelo, "hello.jsp");
});
} }
} }
<html> <html>
<body> <body>
<h2>Hello World!</h2> <h2>Hola puta</h2>
</body> </body>
</html> </html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment