在Java Hibernate中,从两个表中选择“从表单”中获得两个值

发布于 2025-02-05 08:42:24 字数 326 浏览 1 评论 0原文

我坚持这样做:

我在.jsp中选择了一个选择的表单。它从第二个表项目中获取列表=“ $ {categoryList}”。但是,当我想按名称保存选择时,则仅在表A中更新category_id。但是我也需要名字。

有没有办法从一个选择中返回一个列表中的2个值? 摘自JSP

category
    <form:select itemLabel="name" itemValue="id"
                 path="category.id" items="${categoryList}"/>
    enter code here

i stuck on this:

I hava a select form in .jsp. It takes a list from second table items="${categoryList}" . But when i want to save the selection by name then only category_id is updated in table A. I need to have category name in tableA from the list and at the same time category_id in TableA (which works now). But i need name also.

Is there a way to return 2 values from one list in one select?
Extract from jsp

category
    <form:select itemLabel="name" itemValue="id"
                 path="category.id" items="${categoryList}"/>
    enter code here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文