Resteasy 可以填写多部分表格吗?
我知道我可以通过使用 @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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论