나는 다음과 같은 EL/html 태그와 JSP 있습니다는 EL
내 JSP가 렌더링<c:forEach var="key" items="${resource.stringPropertyNames()}">
<tr>
<td>${key}</td>
<td><input type = "text" name = "${key}" value = "${resource.get(key)}"></td>
</tr>
</c:forEach>
는 첫 번째 <td>
태그의 평가 값을 보여줍니다 $ {key}. 그러나 <input>
태그에서 $ {key}는 올바르게 계산되지 않습니다. 내 서블릿 (request.getParameter(StringKey)
)에서 요청 매개 변수로 입력을 검색하려고하면 중괄호없이 리터럴 $key
이 표시됩니다. request.getParameter("$key")
을 할 때 ${resource.get(key)}
이 EL에서 평가하는 문자열에 대해 여러 값을 얻습니다.
무슨 일입니까?
편집
컨트롤러 방법 (사용 봄) 코드 :
@RequestMapping(value = URI_PATH + "{fileName}", method = RequestMethod.GET)
public String getProperties(@PathVariable String fileName, ModelMap modelMap) {
Properties resource = ..//get properties file
modelMap.addAttribute("resource", resource);
return "configuration" // maps to my jsp;
}
를 사용하여 설정되는지도 인 경우 페이지의 소스 코드 (페이지 소스보기)로 이동하여 질문에 붙여 넣으십시오. – gmustudent
'
서블릿에서 속성을 설정하는 경우에는 .xml로 호출 할 필요가 없습니다. – gmustudent