简体   繁体   English

Stripes对表单输入的环绕不会计算c:foreach的loop.index值

[英]Stripes's wraps over form inputs don't calculate c:foreach's loop.index value

I'm doing everything like it is in stripes guide, having simple code in my jsp: 我正在做条纹指南中的所有操作,在我的jsp中有简单的代码:

<c:forEach items="${management.projects}" var="project" varStatus="loop">
<tr>
<td>
    <c:out value="${loop.index}"/>
    <stripes:text name="project[${loop.index}].projectId"/>
</td>
</tr>
</c:forEach>

so then on the html page I can see 0,1,2.. as <c:out...> calculated loop.index, but the name of inputs looks like <input name="project[${loop.index}].projectId" type="text"/> instead of <input name="project[0].projectId" type="text"/> 所以在html页面上,我可以看到0,1,2 .. as <c:out...>计算出的loop.index,但是<input name="project[${loop.index}].projectId" type="text"/>看起来像<input name="project[${loop.index}].projectId" type="text"/>代替<input name="project[0].projectId" type="text"/>

I've tried ' and " and differnet combinations of <c:set..> and <c:out...> but nothing helps. 我已经尝试过'和'和<c:set..><c:out...> differnetnet组合,但是没有任何帮助。

For html form input I found it looks like <input type="text" name="<c:out value='project[${loop.index}].projectId'/>"/> and this will look corectly but if I try to use it in a stripes tag like 对于html表单输入,我发现它看起来像<input type="text" name="<c:out value='project[${loop.index}].projectId'/>"/> ,这看起来很酷,但是如果我尝试在条纹标签中使用它

<stripes:text name="<c:out value='project[${loop.index}].projectId'/>"/>

it fails again even more so - looks like: 它再次失败甚至更多-看起来像:

<input name="<c:out value='project[${loop.index}].projectId'/>" type="text"/>

What am I doing wrong? 我究竟做错了什么?

应该可以,可以尝试

<stripes:text name="project['${loop.index}'].projectId"/>

What is your web-container, and what is its version? 您的网络容器是什么,它的版本是什么? For your need EL manipulation must be done by the web container, before passing parameters to Stripes tags. 根据您的需要,在将参数传递给Stripes标签之前,必须由Web容器完成EL操作。

And I'm not sure whether it is possible to use expressions in name attribute of text tag. 而且我不确定是否可以在文本标签的name属性中使用表达式。

Jost go for Tomcat 6+ Jost选择Tomcat 6+

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM