JSF 면접 질문과 답변
Question: How to access web.xml init parameters from java code?Answer: You can get it using externalContext getInitParameter method. For example, if you have:<context-param> <param-name>connectionString</param-name> <param-value>jdbc:oracle:thin:scott/tiger@cartman:1521:O901DB</param-value> </context-param> You can access this connection string with: FacesContext fc = FacesContext.getCurrentInstance(); String connection = fc.getExternalContext().getInitParameter("connectionString"); |
복습용 저장
이 항목을 북마크하거나, 어렵게 표시하거나, 복습 세트에 넣을 수 있습니다.
도움이 되었나요? 예 아니요
Most helpful rated by users:
- What is JSF?
- What is required for JSF to get started?
- What is JSF architecture?
- How the components of JSF are rendered? An Example
- How JSF different from conventional JSP / Servlet Model?