코딩한파일
VisitList(방명록) - Post 방식 작성
heggy
2021. 1. 12. 17:11
POST방식으로 하려면
server.xml 의 저 부분에다가 URIEncoding = "UTF-8" 를
입력해줘야 한다고 한다. (?)
그리고 bbs 폴더를 만들어서
write.html을 만들었다
사용자의 내용은 "/JSPExample/VisitInsert" 로 보냄
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>방명록 작성</title>
</head>
<body>
<form action="/JSPExample/VisitInsert" method="post">
<table align="center" width="500" border="1" >
<tr>
<th width="70" >작성자</th>
<td width="430">
<input type="text" name="writer" size="50">
</td>
</tr>
<tr>
<th>내 용</th>
<td> <textarea rows="7" cols="50" name="memo"></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="저장">
<input type="reset" value="취소">
</td>
</tr>
</table>
</form>
</body>
</html>
html 파일을 작성한다음
sql developer에 아래 테이블을 만들었다.
시퀀스도 덤으로 만듬
완성화면.
사용자가 폼 양식을 채워서 저장버튼을 누르면
그 내용이 /JSPExample/VisitInsert 에서 지정했던
form action으로 값을 보낸다. (write.html 에서 지정했음)
그 보내진 값을 다루는건 아직
파일 안만들었으므로 오류뜨면 정상이다