Resteasy 可以填写多部分表格吗?

发布于 2024-10-08 02:15:59 字数 443 浏览 0 评论 0原文

我知道我可以通过使用 @MultipartForm 注释将 POJO 绑定到表单来从网页提交表单信息。 (请参阅如何我使用 jax-rs 进行多部分/表单文件上传?)。

然而,我想做的是进行一个 Restful 调用,返回一个包含值的 POJO,并将这些值填充到适当的表单值中,然后用户可以编辑和提交这些值。我知道我可能需要使用 JavaScript 来首先进行其余调用,但此时,有没有办法可以使用结果来填写表单?

我可以让我的其余调用返回表示表单的 JSON,并使用这些值通过 JavaScript 填充表单,但如果这可以自动发生,类似于表单发布,那就太酷了。

谢谢!

I know that I can submit form information from a web page by using the @MultipartForm annotation to bind a POJO to a form. (See How do I do a multipart/form file upload with jax-rs?).

What I would like to do, however, is make a Restful call that returns a POJO containing values, and have those values fill in the appropriate form values, which can then be edited and submitted by the user. I know I'd probably need to use JavaScript to first make the rest call, but at that point, is there a way I can use the result to fill in the form?

I could have my rest call return JSON representing the form and use those values to fill in the form with JavaScript, but it would be cool if this could happen automatically, similar to form posting.

Thanks!

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

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

发布评论

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