Add JSP 추가

This commit is contained in:
daniel LEE 2023-11-01 09:21:03 +09:00
parent 693b4c92f7
commit 5e4fe5f9b3
2 changed files with 36 additions and 18 deletions

View File

@ -10,6 +10,8 @@ import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONObject; import org.json.JSONObject;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
@ -17,7 +19,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PostMapping;
@Controller @Controller
public class JSPController { public class JSPController {
@ -31,18 +33,30 @@ public class JSPController {
// @Value("${openApi.dataType}") // @Value("${openApi.dataType}")
// private String dataType; // private String dataType;
@GetMapping("/add.do") @GetMapping("/add.do")
public String add(Model model) { public String addList(Model model) {
model.addAttribute("id", "id"); // System.out.println( id );
model.addAttribute("name", "name");
// model.addAttribute("id", "id");
// model.addAttribute("name", "name");
return "add"; return "add";
} }
@GetMapping("/addItem")
public void addItem(HttpServletRequest request) {
String id = request.getParameter("id");
System.out.println( id );
}
@GetMapping("/index.do") @GetMapping("/index.do")
public String index(Model model) { public String index(Model model) {

View File

@ -9,22 +9,26 @@
</head> </head>
<body> <body>
<br> <a href="/profile/addItem?id=aaaaa">aaaaaaa</a>
<br>
<br> <br>
<br> <br>
id를 입력하세요. <input type="text" value=""><br><br> <br>
name을 입력하세요. <input type="text" value=""><br><br> <br>
phone을 입력하세요. <input type="text" value=""><br><br> <form action="addItem" method="get">
address를 입력하세요. <input type="text" value=""><br><br> <table>
filePath를 입력하세요. <input type="text" value=""><br><br> <tr>
<td width="50%">ID </td>
<td><input type="text" name="id" size="50"/></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Send"/></td>
</tr>
</table>
</form>
<button onclick="doSave()">저정하기</button>
<script>
function doSave() {
}
</script>
</body> </body>
</html> </html>