반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Tags
- Java
- SpringBoot
- JsonData
- mybatis
- popup
- mysql
- Next.js
- spring3
- MSsql
- ajax
- post
- War
- NextJS
- javascript
- node.js
- jenkins
- MariaDB
- jquery
- spring
- nodejs
- yona
- Maven
- security
- git
- Eclipse
- PM2
- centos7
- rocky9
- console
- config
Archives
- Today
- Total
ふたりで
VO 모델을 json으로 response시 특정 멤버 변수 숨기기 본문
728x90
반응형
SMALL
VO 모델 객체를 json으로 반환 시 특정 멤버를 숨기는 방법.
request와 response의 모델 객체를 하나의 VO객체로 사용할 경우
response시 request용으로만 사용 하는 VO객체의 멤버 변수도 null값으로 같이
반환되게 된다.
이때 @JsonIgnore을 사용 하면 특정 멤버 변수를 숨김 처리할 수 있다.
import org.codehaus.jackson.annotate.JsonIgnore;
/**
* @author graykang
*
*/
public class MartListVO {
private int martCode;
private String martName1;
@JsonIgnore //response시 특정 멤바 변수 숨김 처리.
private String phoneNo;
/**
* @return the martCode
*/
public int getMartCode() {
return martCode;
}
/**
* @param martCode the martCode to set
*/
public void setMartCode(int martCode) {
this.martCode = martCode;
}
/**
* @return the martName1
*/
public String getMartName1() {
return martName1;
}
/**
* @param martName1 the martName1 to set
*/
public void setMartName1(String martName1) {
this.martName1 = martName1;
}
/**
* @return the phoneNo
*/
public String getPhoneNo() {
return phoneNo;
}
/**
* @param phoneNo the phoneNo to set
*/
public void setPhoneNo(String phoneNo) {
this.phoneNo = phoneNo;
}
}
728x90
반응형
LIST
'Spring' 카테고리의 다른 글
JWT 토큰 유효기간 설정. (0) | 2021.10.29 |
---|---|
springboot starting WARN o.a.t.util.scan.StandardJarScanner - Failed to scan java.io.FileNotFoundException "*.jar" (0) | 2021.10.15 |
springboot @Transactional not working... (0) | 2021.07.27 |
springboot+security+csrf 설정 및 예외처리 설정. (0) | 2021.04.05 |
springboot+war(deploy error ServletInitializer(listenerStop) contextDestroyed 실패시 해결...) (0) | 2021.03.22 |
Comments