-
1. Re: Seam Page Parameters
iradix Nov 6, 2006 2:51 PM (in response to iradix)Ok, let me amend that. I just tried it with the page action returning a symbolic view-id and it still doesn't get added as a query parameter during the redirect. I'm using 1.1 beta. Am I missing something?
-
2. Re: Seam Page Parameters
pmuir Nov 6, 2006 3:19 PM (in response to iradix)I may misunderstand what you are about, but can't you return null from the action method to stay on the same page? Not sure if that fixes the page parameters problem...
-
3. Re: Seam Page Parameters
iradix Nov 6, 2006 3:25 PM (in response to iradix)I believe returning null would result in a forward to the same page, I'm looking for a redirect. Returning a view-id that begins with a / (like /products/search.jsf) does seem to redirect correctly. Does anyone have page parameters working? I've started looking through the source and it seems like they are appended by the SeamRedirectFilter, which I'm using.
-
4. Re: Seam Page Parameters
gavin.king Nov 6, 2006 3:28 PM (in response to iradix)This should work fine. SeamRedirectFilter does the job of appending them, so try putting a breakpoint in the sendRedirect() method to see why its not working for you.
-
5. Re: Seam Page Parameters
iradix Nov 6, 2006 4:28 PM (in response to iradix)It looks like it's a bug. The method
public static String getViewId(String url)
in the SeamRedirectFilter usesurl.substring(contextPath.length(), getParamLoc(url) - suffix.length() + 1) + suffix;
to calculate the viewId, but that seems to clip the last character off. I think thaturl.substring(contextPath.length(), getParamLoc(url) - suffix.length() + 2) + suffix;
is correct and it works after I made the change locally. -
6. Re: Seam Page Parameters
iradix Nov 6, 2006 4:33 PM (in response to iradix)Wait, I take that back.
url.substring(contextPath.length(), getParamLoc(url) - extension.length() + 1) + suffix;
Is probably what you were looking for... I'll test that. -
7. Re: Seam Page Parameters
iradix Nov 6, 2006 4:47 PM (in response to iradix)Wrong again. Looks like the winning combo is:
url.substring(contextPath.length(), getParamLoc(url) - extension.length()) + suffix;
They way it was probably worked because you were going from a .seam URL to a 3 character version (.jsp maybe?) whereas I'm going from .jsf to .xhtml for facelets. -
8. Re: Seam Page Parameters
gavin.king Nov 6, 2006 6:10 PM (in response to iradix)Thanks, appreciated. I've committed your fix.
-
9. Re: Seam Page Parameters
iradix Nov 7, 2006 12:43 PM (in response to iradix)No problem. Happy to help.
-
10. Re: Seam Page Parameters
iradix Nov 7, 2006 3:41 PM (in response to iradix)I'm running into another problem. It seems that the converter specified in pages.xml is used to convert from String to Object, but not from Object to String. I don't suppose that's by design? The method I'm looking at is:
public Map<String, Object> getParameters(String viewId, Set<String> overridden) { Map<String, Object> parameters = new HashMap<String, Object>(); for ( PageParameter pageParameter: getPage(viewId).pageParameters ) { if ( !overridden.contains(pageParameter.name) ) { Object value = pageParameter.valueBinding.getValue(); if (value!=null) { parameters.put(pageParameter.name, value); } } } return parameters; }
Which seems to just retrieve the value from the page parameter value binding without passing it through the converter at all. -
11. Re: Seam Page Parameters
gavin.king Nov 7, 2006 9:25 PM (in response to iradix)Nice catch, I'll fix it.
-
-
13. Re: Seam Page Parameters
gavin.king Nov 8, 2006 1:53 AM (in response to iradix)Done in CVS, please test this for me. thanks
-