Struts 中的条件形式动作
我想让一个 jsp 页面有条件地发布到两个不同的 Struts 操作。 所以我写了这个:
<logic:notEmpty property="foo">
<html:form action="modifyUser">
</logic:notEmpty>
<logic:empty property="foo">
<html:form action="modifySelf">
</logic:empty>
the body of the page
</html:form>
结果我得到了这个,
Compilation of JSP File '/tiles/user/modify.jsp' failed:
modify.jsp:8:2: No end tag found.
<html:form action="modifyUser">
^-------^
modify.jsp:8:2: No end tag found.
<html:form action="modifyUser">
^-------^
modify.jsp:11:2: No end tag found.
<html:form action="modifySelf">
^-------^
modify.jsp:11:2: No end tag found.
<html:form action="modifySelf">
^-------^
modify.jsp:109:3: No start tag found.
</html:form>
^-------^
modify.jsp:109:3: No start tag found.
</html:form>
^-------^
我猜测解析器正在寻找逻辑之前的形式,或者至少匹配所有标签。
关于如何获得相同效果有什么想法吗? 我也在瓷砖内跑步。
I wanted to have one jsp page conditionally post to two different Struts actions.
So I wrote this:
<logic:notEmpty property="foo">
<html:form action="modifyUser">
</logic:notEmpty>
<logic:empty property="foo">
<html:form action="modifySelf">
</logic:empty>
the body of the page
</html:form>
As a result I got this
Compilation of JSP File '/tiles/user/modify.jsp' failed:
modify.jsp:8:2: No end tag found.
<html:form action="modifyUser">
^-------^
modify.jsp:8:2: No end tag found.
<html:form action="modifyUser">
^-------^
modify.jsp:11:2: No end tag found.
<html:form action="modifySelf">
^-------^
modify.jsp:11:2: No end tag found.
<html:form action="modifySelf">
^-------^
modify.jsp:109:3: No start tag found.
</html:form>
^-------^
modify.jsp:109:3: No start tag found.
</html:form>
^-------^
I am guessing that the parser is looking for forms before logic, or at least matching all the tags.
Any thoughts on how to get the same effect?
I am running within tiles also.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种解决方案:
One solution: