JSONObject jsonObject = new JSONObject();for (Map.Entry entry : param.entrySet()) {String key = entry.getKey();Object value = entry.getValue();jsonObject.put(key, value);} (Map param) 으로 넘거받은 파라미터를 json으로 변환하는 과정 반대로json -> map으로 변환하는 과정ObjectMapper mapper = new ObjectMapper();Map map = new hashMap();map = mapper.convertValue(jsonObject, map.class); json -> dto로 변환DTO dto = new DTO(); ObjectMapp..
[string to date] String thisDay = param.get("date").toString(); SimpleDateFormat transFormat = new SimpleDateFormat("yyyy-MM-dd"); Calendar calendar = Calendar.getInstance(); Date date = transFormat.parse(thisDay); [date to string] String nextDay = transFormat.format(date); https://www.javatpoint.com/java-string-to-date [string ad nextday] String thisDay = param.get("date").toString(); SimpleDat..
리스트를 전달하기 위해 검색을 많이 해봣지만대부분 리스트타입을 리스트 타입으로 넘기거나, json을 json으로 넘기는 경우가 많았다. 내 경우 리스트와 함게 string타입의 다른 파라미터도 같이 넘겨 db를 타는 경우가 많기 때문에파라미터타입을 map으로 주로 사용을 한다. 아래의 경우 파라미터 타입을 HashMap으로 사용하는 경우이다. [script]리스트를 json타입으로 변환해준 후 ajax를 통해 controller로 전달var dataParam = {list:JSON.stringify($scope.lists), param1:'param1', param2:'param2'};$.ajax({type : 'POST', dataType : 'json', data: dataParam,url : url..
- Total
- Today
- Yesterday
- module
- Redux
- 스프링
- 클래스형
- nodeJS
- input
- javascript
- JSON
- hashmap
- typescript
- Progressbar
- datePicker
- React
- value
- paging
- 함수형
- date
- script
- JSX
- ajax
- Props
- Spring
- webpack
- html
- angular
- hooks
- java
- 리액트
- list
- JSP
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |