import com.webmotionserver.core.WebApplication; public class Main { public static void main(String[] args) { WebApplication app = new WebApplication(); app.get("/", (req, res) -> { }); app.post("/login", (req, res) -> { String username = req.getParameter("username"); String password = req.getParameter("password"); if (username.equals("admin") && password.equals("admin123")) { } else { } }); app.start(8080); } } html <!DOCTYPE html> <html> <head> <title>Login</title> </head> <body> <form action="/login" method="post"> <input type="text" name="username" placeholder="Username"> <input type="password" name="password" placeholder="Password"> <button type="submit">Login</button> </form> </body> </html> html <!DOCTYPE html> <html> <head> <title>Login Success</title> </head> <body> <h1>Login Successful</h1> </body> </html> html <!DOCTYPE html> <html> <head> <title>Login Error</title> </head> <body> <h1>Login Error</h1> </body> </html> port=8080 db.url=jdbc:mysql://localhost:3306/mydatabase db.username=root db.password=123456


上一篇:
下一篇:
切换中文