【发布时间】:2013-02-15 13:32:43
【问题描述】:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
在“form:form”中
<form:form class="form-container" name ="feedback_popup_form" id="feedback_popup_form" action="savefeedback" method="post" modelAttribute="feedbackVO" commandName="feedbackVO">
<form:input type="hidden" path="strEmplRefrlSeq" value="${model.strEmplRefrlSeq}" />
<input type="hidden" id="mady" value = "${fn:length(model.strEmplRefrlSeq)}" />
在萤火虫中我得到了
<input id="strEmplRefrlSeq" type="hidden" value="2,10,11," name="strEmplRefrlSeq">
<input id="mady" type="hidden" value="0">
我的 fn:length 不适用于字符串输入。你能解释一下为什么会这样吗?
【问题讨论】:
-
model.strEmplRefrlSeq 类型是什么?字符串?
-
请向我们展示实际代码。
<input type="hidden" path="strEmplRefrlSeq" value="${model.strEmplRefrlSeq}" />不可能变成<input id="strEmplRefrlSeq" type="hidden" value="2,10,11," name="strEmplRefrlSeq">。 name 属性从何而来?为什么路径属性(不是有效的 HTML BTW)会消失? -
如上所述,它在 form:form jstl 标记内,将路径转换为 id 和名称
标签: forms jsp spring-mvc jstl