使用Seam / JSF获取表单请求

时间:2021-05-27 19:59:17

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. 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?

我有一个查询表单,我想作为GET请求提交,因此结果页面可能被加入书签,否则就是RESTful。这是带有提交按钮的经典文本字段。我如何诱导Seam / JSF使用GET并将查询表达式包含为参数而不是POST,默认情况下?

3 个解决方案

#1


2  

All you need to do is enable the SeamFilter in web.xml. See Blog Example for an example RESTful application using Seam. The key is to use a Seam page parameter, defined in WEB-INF/pages.xml

您需要做的就是在web.xml中启用SeamFilter。有关使用Seam的示例RESTful应用程序,请参阅博客示例。关键是使用在WEB-INF / pages.xml中定义的Seam页面参数

#2


1  

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

#3


1  

If you are using s:button or s:link, your form will be using GET method.

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

#1


2  

All you need to do is enable the SeamFilter in web.xml. See Blog Example for an example RESTful application using Seam. The key is to use a Seam page parameter, defined in WEB-INF/pages.xml

您需要做的就是在web.xml中启用SeamFilter。有关使用Seam的示例RESTful应用程序,请参阅博客示例。关键是使用在WEB-INF / pages.xml中定义的Seam页面参数

#2


1  

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

#3


1  

If you are using s:button or s:link, your form will be using GET method.

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