动态struts
如何编写动态struts
,我正在执行以下操作
<logic:iterate id="data" name="sendEmailForm" property="eventList">
<html:option value="<bean:write name="data" property="eventId"/>"/>
<bean:write name="data" property="title"/>
</html:option>
</logic:iterate>
,但出现以下错误:
JSPG0069E: 解析 jsp 时发现不匹配的结束标记。期待 逻辑:迭代在 [87,130] 处找到了 html:option
还有其他方法吗?
提前致谢。
How to write dynamic struts <html:option>
, I'm doing as below
<logic:iterate id="data" name="sendEmailForm" property="eventList">
<html:option value="<bean:write name="data" property="eventId"/>"/>
<bean:write name="data" property="title"/>
</html:option>
</logic:iterate>
but getting following error:
JSPG0069E: Unmatched end tag found while parsing jsp. Expecting
logic:iterate found html:option at [87,130]
is there another way to do so?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
html:选项标签
property="?"
无论你想设置什么,比如属性是标题和相应的方法(getTitle()
,setTitle(String title) ) 然后
property= "title"
html:optionsCollection 标签
name = "?"
您在请求/会话属性中输入的任何内容就像
(request Or session).setAttribute("sendEmailForm", ListArr);
然后名称=“sendEamilForm”
listArr
是 bean 对象的数组(可以是 formbean 或简单的 pojofile/bean)。label ="?"
如果你有属性'title'
并且你想显示什么相应的setter(setTitle(String title))和getter(getTitle())方法然后
标签=“标题”
value ="?"
你想在选项中添加什么值。你调用你的 getter 方法相应的属性,例如如果您有属性 eventId 和方法(
setEventId(String eventId) , getEventId()
) 然后value="eventId"
html:option tag
property="?"
whatever you want to set like if attribute is title and corresponding method (getTitle()
,setTitle(String title)
) thenproperty= "title"
html:optionsCollection tag
name = "?"
whatever you have put in your request/session attributelike
(request Or session).setAttribute("sendEmailForm", ListArr);
then name="sendEamilForm"
listArr
is array of object of bean ( may be formbean or simple pojofile/bean).label ="?"
what ever you want to show like if you have attribute'title'
andcorresponding
setter(setTitle(String title)
) andgetter(getTitle()
) method thenlabel="title"
value ="?"
what ever you want to put as value in option. you call your getter methodcorresponding attribute like if you have attribute eventId and method (
setEventId(String eventId) , getEventId()
) thenvalue="eventId"
好的,最后我找到了下面的解决方案
ok finally i found below for solution