-
1. Re: Request paramter, url rewrite and form submit
germanescobar Dec 19, 2009 8:21 PM (in response to bashan)If you are not using conversations you can use the s:button with the propagation=none option to avoid the cid parameter.
-
2. Re: Request paramter, url rewrite and form submit
bashan Dec 20, 2009 9:38 AM (in response to bashan)Thanks for your reply, but my big problem is how to preserve the request parameter on a postback, when validation fails. Looks like Seam simply have no solution for this problem...
-
3. Re: Request paramter, url rewrite and form submit
germanescobar Dec 20, 2009 4:38 PM (in response to bashan)Post the relevant pages.xml and your page code.
-
4. Re: Request paramter, url rewrite and form submit
bashan Dec 20, 2009 10:59 PM (in response to bashan)<page view-id="/upload.xhtml" login-required="true"> <rewrite pattern="/upload/{type}"/> <rewrite pattern="/upload"/> <param name="type" required="false" /> </page>
-
5. Re: Request paramter, url rewrite and form submit
germanescobar Dec 21, 2009 3:28 AM (in response to bashan)I guess you are using @RequestParameter. Instead, use
... private String type; @Create public void init() { type = (String) Contexts.getEventContext().get("type"); } ...
Or you can use a page action to achieve the same result.
-
6. Re: Request paramter, url rewrite and form submit
bashan Dec 21, 2009 9:56 PM (in response to bashan)Hi,
I tried in the way you suggested and it doesn't work.
I don't really understand how should it... Frankly I am not sure Seam has a solution for this issue... -
7. Re: Request paramter, url rewrite and form submit
germanescobar Dec 21, 2009 10:35 PM (in response to bashan)Still getting null after postback?
I know that if you are using @RequestParameter, Seam will not preserve the request parameter on postback. That's why you shouldn't use the annotation. However, you can retrieve the request parameter using the event context like in my previous post. This way, you can save the request parameter in another variable inside your bean.
Just be sure that the bean where you will save the request parameter has a Page or Conversation scope.
It should work.
-
8. Re: Request paramter, url rewrite and form submit
bashan Dec 21, 2009 10:55 PM (in response to bashan)Hi,
I have no problem of saving the request parameter value. I want that the request parameter will stay there after a form submit, even if there were validation errors. But as I was saying and you also clarified: looks like Seam simply doesn't support this behavior. I hope it will be supported in the future, since the URL looses it's meaning after a postback, and it doesn't looks so
pretty
. -
9. Re: Request paramter, url rewrite and form submit
germanescobar Dec 21, 2009 11:02 PM (in response to bashan)I don't think that should be a standard behaviour. What if you don't want the request parameter to be preserved? or what if you want to change the value of the request parameter on a postback?
-
10. Re: Request paramter, url rewrite and form submit
bashan Dec 22, 2009 5:12 PM (in response to bashan)On old style JSP, when you go to a page with a form with
POST
method, and there are request parameters on the url, they are preserved, even if you stay on the same page after pressing the submit. So it seems logic to me that JSF/Seam should preserve this behavior. Of course, like you say, there should be an option to rewrite the url parameter in cases you want to change the value. But, I think (this is only my experience, others may think differently), that in most cases, you simply go to a page with some parameter and want the same parameter simply to stay after a postback.