ulzcq / form Goto Github PK
View Code? Open in Web Editor NEW[MVC2] 스프링 통합과 타임리프 학습용 리포지토리
[MVC2] 스프링 통합과 타임리프 학습용 리포지토리
타임리프를 사용해서 폼에서 체크박스, 라디오 버튼, 셀렉트 박스를 편리하게 사용하는 방법을 학습해보자.
기존 상품 서비스에 다음 요구사항이 추가되었다.
상품 종류는 ENUM
을 사용한다. 설명을 위해 description 필드를 추가했다.
배송 방식은 DeliveryCode
라는 클래스를 사용한다. code 는 FAST 같은 시스템에서 전달하는 값이고,
displayName
은 빠른 배송 같은 고객에게 보여주는 값이다.
ENUM
, 클래스, String
같은 다양한 상황을 준비했다. 각각의 상황에 어떻게 폼의 데이터를 받을 수 있는지
하나씩 알아보자.
@Data
public class Item {
...
private String deliveryCode;// 배송 방식
/**
* FAST: 빠른 배송
* NORMAL: 일반 배송
* SLOW: 느린 배송
*/
@Data
@AllArgsConstructor
public class DeliveryCode {
private String code; //시스템에서 전달하는 값
private String displayName; // 고객에게 보여주는 값
}
disabled
를 사용해서 상품 상세에서는 셀렉트 박스가 선택되지 않도록 한다A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.