diff --git a/src/main/java/fr/sixthemes/CreateCTHandler.java b/src/main/java/fr/sixthemes/CreateCTHandler.java index 9c372de..d49b808 100644 --- a/src/main/java/fr/sixthemes/CreateCTHandler.java +++ b/src/main/java/fr/sixthemes/CreateCTHandler.java @@ -18,6 +18,17 @@ public class CreateCTHandler extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + + String hostname = !req.getParameter("hostname").equals("") ? req.getParameter("hostname") : "default-hostname"; + String cores = !req.getParameter("cores").equals("") ? req.getParameter("cores") : "2"; + String ram = !req.getParameter("ram").equals("") ? req.getParameter("ram") : "1024"; + String disk = !req.getParameter("disk").equals("") ? req.getParameter("disk") : "16"; + + req.setAttribute("hostname", hostname); + req.setAttribute("cores", cores); + req.setAttribute("ram", ram); + req.setAttribute("disk", disk); + this.getServletContext().getRequestDispatcher("/WEB-INF/createct.jsp").forward(req, resp); } diff --git a/src/main/webapp/WEB-INF/createct.jsp b/src/main/webapp/WEB-INF/createct.jsp index 06b6f0e..1a8a1af 100644 --- a/src/main/webapp/WEB-INF/createct.jsp +++ b/src/main/webapp/WEB-INF/createct.jsp @@ -12,10 +12,10 @@