简体   繁体   English

使用Seam / JSF获取表单请求

[英]Get Form request with Seam/JSF

I have a query form that I would like to submit as a GET request so the result page may be bookmarked and otherwise RESTful. 我有一个查询表单,我想作为GET请求提交,因此结果页面可能被加入书签,否则就是RESTful。 It's your classical text field with a submit button. 这是带有提交按钮的经典文本字段。 How do I induce Seam/JSF to use GET and include the query expression as a parameter rather than POST, the default? 我如何诱导Seam / JSF使用GET并将查询表达式包含为参数而不是POST,默认情况下?

All you need to do is enable the SeamFilter in web.xml. 您需要做的就是在web.xml中启用SeamFilter。 See Blog Example for an example RESTful application using Seam. 有关使用Seam的示例RESTful应用程序,请参阅博客示例 The key is to use a Seam page parameter, defined in WEB-INF/pages.xml 关键是使用在WEB-INF / pages.xml中定义的Seam页面参数

you can use a PhaseListener to convert POST requests to GET requests or just to interpret GET requests so that they can be bookmarkable. 您可以使用PhaseListener将POST请求转换为GET请求,或者只是解释GET请求,以便它们可以加入书签。

This page should explain in more detail: 这个页面应该更详细地解释:

http://balusc.blogspot.com/2007/03/post-redirect-get-pattern.html http://balusc.blogspot.com/2007/03/post-redirect-get-pattern.html

如果您使用s:buttons:link ,您的表单将使用GET方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM