动态struts

发布于 2024-09-28 09:22:37 字数 513 浏览 0 评论 0原文

如何编写动态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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雾里花 2024-10-05 09:22:37
<html:option property="title">
<html:optionsCollection name="sendEmailForm" label="title" value="eventId" />
<html:option>
  1. html:选项标签

    property="?" 无论你想设置什么,比如属性是标题和相应的方法(getTitle(), setTitle(String title) ) 然后 property= "title"

  2. 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 property="title">
<html:optionsCollection name="sendEmailForm" label="title" value="eventId" />
<html:option>
  1. html:option tag

    property="?" whatever you want to set like if attribute is title and corresponding method (getTitle(), setTitle(String title) ) then property= "title"

  2. html:optionsCollection tag

    • name = "?" whatever you have put in your request/session attribute
      like (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' and
      corresponding setter(setTitle(String title)) and getter(getTitle()) method then
      label="title"

    • value ="?" what ever you want to put as value in option. you call your getter method
      corresponding attribute like if you have attribute eventId and method (
      setEventId(String eventId) , getEventId() ) then value="eventId"

jJeQQOZ5 2024-10-05 09:22:37

好的,最后我找到了下面的解决方案

<html:optionsCollection name="sendEmailForm" property="eventList" label="title" value="eventId" />

ok finally i found below for solution

<html:optionsCollection name="sendEmailForm" property="eventList" label="title" value="eventId" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文