IT칼럼/JAVA
iframe 으로 get request 이용하여 데이터 전달하기 + spring boot
VanDevKIM
2019. 4. 26. 02:45
1. main.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>iframe main</title> </head> <body> <form id="loginForm" target="myFrame" action="/iframe" method="get"> <input type="text" name="username" value=“username” /> <input type="text" name="password" value="password" /> <input type="submit"> </form> <iframe name="myFrame" src="/iframe"> Your browser does not support inline frames. </iframe> </body> </html> |
2. iframe.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> </head> <body> <p th:text="${username}"></p> <p th:text="${password}"></p> </body> </html> |
3. spring controller
@GetMapping(“/index”) @GetMapping("/iframe") |