如何从 Tapestry BeanEditForms 获取数据?
我正在使用 Tapestry 5,并且我有一个页面,上面有一个 Bean 编辑表单。单击提交后如何获取以该表单提交的数据?我不想使用 Hibernate 来保存数据(我正在使用 Spring JdbcTemplate
)。我想使用表单中的数据将它们添加到 SQL 查询中。
I'm using Tapestry 5 and I have a page on which I have a bean edit form. How do I get data submitted in that form after click on submit? I don't want to use Hibernate to persist the data (I'm using Spring JdbcTemplate
). I want to use the data from forms to add them to SQL query.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用
BeanEditForm
,则您已经拥有某种指定为object
参数的支持bean。这是呈现表单时表单数据的来源,也是提交表单时数据的去向。BeanEditForm
组件包含一个Form
组件,就像您手动编写表单时一样。您可以像平常一样为页面类中的所有标准事件创建事件处理程序会:另请参阅 Bean 编辑表单指南 和 Tapestry 上 BeanEditForm 组件的组件参考地点。
If you use a
BeanEditForm
, you already have some kind of backing bean which you specified as theobject
parameter. That's where the data for the form is coming from when the form is rendered, and that's also where it is going when the form is submitted.The
BeanEditForm
component contains aForm
component just like when you'd hand-code your form. You can create event handlers for all the standard events in your page class, just like you usually would:Also check out the Bean Edit Form Guide and the component reference for the BeanEditForm component on the Tapestry site.