struts 标签使用求救!

wh176781788 2008-12-02 04:21:28
我现在需要传入一个map到页面的下拉列表里。 这个select被选中的需要返回map的key ,option中显示的label是id+“ ”+key
这个用标签该怎么写呢。。我的是1.1版本的struts。谢谢。
...全文
74 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
忙碌的布谷鸟 2008-12-05
  • 打赏
  • 举报
回复
products是一个集合
wh176781788 2008-12-03
  • 打赏
  • 举报
回复
自己顶起来!
wh176781788 2008-12-03
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 guoquanyou 的回复:]
当初我是这么做的,不知有没有参考价值。

<logic:notPresent name="products" scope="request">信息暂时没有! </logic:notPresent>
<logic:present name="products" scope="request">
    <html:select property="productCata">
    <html:options collection="products" property="id" labelProperty="productCata"/>
      </html:select>
</logic:present>
[/Quote]

product是map么??
tzb08 2008-12-03
  • 打赏
  • 举报
回复
顶的这么厉害,吃啥药了
wh176781788 2008-12-03
  • 打赏
  • 举报
回复
自己顶起来!
忙碌的布谷鸟 2008-12-02
  • 打赏
  • 举报
回复
当初我是这么做的,不知有没有参考价值。

<logic:notPresent name="products" scope="request">信息暂时没有!</logic:notPresent>
<logic:present name="products" scope="request">
<html:select property="productCata">
<html:options collection="products" property="id" labelProperty="productCata"/>
</html:select>
</logic:present>
wh176781788 2008-12-02
  • 打赏
  • 举报
回复
继续顶起来~~~~~
wh176781788 2008-12-02
  • 打赏
  • 举报
回复
[Quote=引用楼主 wh176781788 的帖子:]
我现在需要传入一个map到页面的下拉列表里。 这个select被选中的需要返回map的key ,option中显示的label是id+“  ”+key
这个用标签该怎么写呢。。我的是1.1版本的struts。谢谢。
[/Quote]

option中显示的label是id+“ ”+key 写错了 是key+ vlue 就是要显示给用户看到的
yulu0214 2008-12-02
  • 打赏
  • 举报
回复
我用的是struts2.....
tiger868686 2008-12-02
  • 打赏
  • 举报
回复
能说的更清楚一点吗?option中显示的label是id+“ ”+key 是指option text(即用户看到的值)吗?这

个id从哪里来啊
wh176781788 2008-12-02
  • 打赏
  • 举报
回复
自己顶起来!

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧