private Map<String, Map<String, String>> data = new HashMap<String,
Map<String, String>>();
private String type;
private Map<String, String> types;
@PostConstruct
public void init() {
formSchema = new JSONObject();
types = new HashMap<String, String>();
types.put("name", "name");
types.put("address", "address");
types.put("number", "Number");
}
public Map<String, Map<String, String>> getData() {
return data;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Map<String, String> getTypes() {
return types;
}
이것은 내 드롭 다운 메뉴의 코드입니다.Java에서 JSON으로 DropDown 채우기
나는이 하드 코드 된 값으로 잘 작동
<b:selectOneMenu id="type" value="#{dropdownView.type}"
style="width:150px">
<f:selectItem itemLabel="Select type" itemValue=""
noSelectionOption="true" />
<f:selectItems value="#{dropdownView.types}" />
</b:selectOneMenu>
된 직후 XHTML에 값을 전달하고 있지만 JSON 스키마와 드롭 다운 메뉴를 채울 필요가있다.
저는 Json 값 (예 : 이름, 주소 및 번호)을 드롭 다운 메뉴로 보내고 Dropdown.Any 도움말의 값을 표시하는 방법과 관련하여 제게 초보자입니다. 도움을 받으실 수는 있습니다. 미리 감사드립니다. 예를 들어 JSON 형식으로 보내기
-
{ "형태": { "이름": "ABC", "ID": "숫자", "날짜": "사실", "코멘트" " largeText "}}
1. JSON의 구조는 무엇입니까? 제발, 예를 들어. 2.이 JSON을 코드에서 사용할 수있는 방법 (매개 변수로 전달, 어딘가에서로드, 컨테이너로 주입? – kgeorgiy