api.springboot.mybatis/src/main/webapp/WEB-INF/views/add.jsp

53 lines
1.6 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<%@ page import="com.example.demo.controller.JSPController"%>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="http://code.jquery.com/jquery-3.4.1.min.js"></script>
<script>
$(document).ready(function(){
$('#add').on('click', function(){
$.ajax({
url: "/user/10",
type: "POST",
data: $('#theForm').serialize(),
success: function(data){
//location.href="listUser.do";
alert("신규등록 OK");
},
error: function(error){ alert(error); }
});
});
});
</script>
</head>
<body>
<!-- <a href="/profile/addItem?id=aaaaa">aaaaaaa</a> -->
<br>
<br>
<br>
<br>
<form id="theForm" method="post" enctype=”multipart/form-data”>
<table>
<tr>
<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>
</body>
</html>