FacesContext
과 ExternalContext
의 차이점은 무엇입니까? 하나 또는 다른 것을 언제 사용할 수 있습니까? 그 중 하나가 무엇이고 다른 하나는 무엇입니까?FacesContext와 ExternalContext의 차이점
<h:commandButton ... actionListener="#{rushmore.handleMouseClick}" />
백업 콩 :
다음 예제는 자바 서버가 3 판을 얼굴 책에서입니다
public void handleMouseClick(ActionEvent e) {
FacesContext context = FacesContext.getCurrentInstance();
String clientId = e.getComponent().getClientId(context);
Map<String, String> requestParams = context.getExternalContext().getRequestParameterMap();
// ...
}
왜 ExternalContext
의 요청 매개 변수는? clientId
은 무엇입니까? 애플리케이션이 시작될 때 JSF에 의해 생성됩니까?