add.jsp 수정
This commit is contained in:
parent
d71663e0d6
commit
1efd16f1ac
|
|
@ -48,15 +48,6 @@ public class JSPController {
|
|||
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) {
|
||||
|
|
|
|||
|
|
@ -8,29 +8,19 @@
|
|||
<title>Insert title here</title>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js" ></script> <!--jQuery 불러오기-->
|
||||
<script src="http://code.jquery.com/jquery-3.4.1.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#buttonSubmit").on('click',function(){ // 제출 버튼 이벤트 지정
|
||||
$('#add').on('click', function(){
|
||||
$.ajax({
|
||||
url: "https://api.leejk0523.com/profile/user/10", // 목적지
|
||||
async: true,
|
||||
type: "POST", // HTTP Method
|
||||
data: $("#theForm").serialize(), // 전송 데이터
|
||||
dataType: "text", // 전송 데이터 형식
|
||||
success: function(result, status){ // 성공 시 실행
|
||||
console.log("성공');
|
||||
console.log(data.status);
|
||||
alert(result);
|
||||
|
||||
//$("#result_name").html(res.name);
|
||||
//$("#result_ph_number").html(res.ph_number);
|
||||
//$("#result_address").html(res.address);
|
||||
url: "/user/10",
|
||||
type: "POST",
|
||||
data: $('#theForm').serialize(),
|
||||
success: function(data){
|
||||
//location.href="listUser.do";
|
||||
alert("신규등록 OK");
|
||||
},
|
||||
error:function(equest, status, error) { //실패 시 실행
|
||||
console.log("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
|
||||
alert("실패 원인 : " + error);
|
||||
}
|
||||
error: function(error){ alert(error); }
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
@ -48,9 +38,11 @@
|
|||
<form id="theForm" method="post" enctype=”multipart/form-data”>
|
||||
<table>
|
||||
<tr>
|
||||
<td>ID <input type="text" name="id" size="50"/><br></td>
|
||||
<td><input type="file" multiple="multiple" name="fileob"></td>
|
||||
<td><input id="buttonSubmit" type="submit" value="Send"/></td>
|
||||
<td>Name <input type="text" id="name" name="name" value="50"/><br></td>
|
||||
<td>Phone <input type="text" id="phone" name="phone" value="50"/><br></td>
|
||||
<td>Address <input type="text" id="address" name="address" value="50"/><br></td>
|
||||
<td>File<input type="file" multiple="multiple" id="upfile"></td>
|
||||
<td><input id="add" type="button" value="Send"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Reference in New Issue