백엔드에서는 폼태그를 어떻게 사용할까?
프론트엔드에서 폼태그를 사용한다는것은 결국 백엔드와 협업한다는 의미입니다.
그러한 이유로 백엔드에서 html을 어떻게 사용하는지 알고 있다면 도움이 될것입니다.
프론트엔드 폼 코딩과 백엔드 폼코딩이 어떻게 다른지 아래 예제 코드로 체크해 두기를 바랍니다.
아래 코딩은 아직 코딩중인 기본 코드입니다.
<html layout:decorate="~{layout}">
<div layout:fragment="content" class="container">
<h5 class="my-3 border-bottom pb-2">질문등록</h5>
<form th:action="@{/question/create}" method="post">
<div class="mb-3">
<label for="subject" class="form-label">제목</label>
<input type="text" name="subject" id="subject" class="form-control">
</div>
<div class="mb-3">
<label for="content" class="form-label">내용</label>
<textarea name="content" id="content" class="form-control" rows="10"></textarea>
</div>
<input type="submit" value="저장하기" class="btn btn-primary my-2">
</form>
</div>
</html>
코드 출처
2-16 질문 등록 기능 추가하기
* `[완성 소스]` : [https://github.com/pahkey/sbb3/tree/v2.16](https://github.com/pahkey/sbb3/tree/v2.16…
wikidocs.net

'HTML' 카테고리의 다른 글
| 코딩을 처음하는 분들을 위한 HTML <head> 코드 추천 (0) | 2026.03.18 |
|---|---|
| Semantic tag (0) | 2026.02.19 |
| HTML structure and comment (0) | 2026.02.19 |
| Hyper link tag and property (0) | 2026.02.18 |
| Multimedia tag and property (0) | 2026.02.18 |