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

View File

@ -9,22 +9,26 @@
</head>
<body>
<br>
<br>
<br>
<br>
id를 입력하세요. <input type="text" value=""><br><br>
name을 입력하세요. <input type="text" value=""><br><br>
phone을 입력하세요. <input type="text" value=""><br><br>
address를 입력하세요. <input type="text" value=""><br><br>
filePath를 입력하세요. <input type="text" value=""><br><br>
<a href="/profile/addItem?id=aaaaa">aaaaaaa</a>
<br>
<br>
<br>
<br>
<form action="addItem" method="get">
<table>
<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>
</html>