简体   繁体   中英

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

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

you can use a PhaseListener to convert POST requests to GET requests or just to interpret GET requests so that they can be bookmarkable.

This page should explain in more detail:

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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