OK thanks, I'll take a poke under the hood then. On Wed, Jan 9, 2013 at 3:35 AM, Remi VANKEISBELCK <r...@rvkb.com> wrote: > > Le 8 janv. 2013 à 16:27, Chris Cheshire a écrit : > > > > > What's getLastUrl() ? Could you post a snippet maybe (don't have the Stripes > Book under hand... boooo bad bad bad) ? > > > > public String getLastUrl() { > HttpServletRequest req = getContext().getRequest(); > StringBuilder sb = new StringBuilder(); > > // Start with the URI and the path > String uri = (String) > req.getAttribute("javax.servlet.forward.request_uri"); > String path = (String) > req.getAttribute("javax.servlet.forward.path_info"); > if (uri == null) { > uri = req.getRequestURI(); > path = req.getPathInfo(); > } > sb.append(uri); > if (path != null) { sb.append(path); } > > // Now the request parameters > sb.append('?'); > Map<String,String[]> map = > new HashMap<String,String[]>(req.getParameterMap()); > > // Remove previous locale parameter, if present. > map.remove(MyLocalePicker.LOCALE); > > // Append the parameters to the URL > for (String key : map.keySet()) { > String[] values = map.get(key); > for (String value : values) { > sb.append(key).append('=').append(value).append('&'); > } > } > // Remove the last '&' > sb.deleteCharAt(sb.length() - 1); > > return sb.toString(); > } > > > Is this just an artifact of the clean urls and binding the fields into > > the url like that, or is there something I can do so that the field > > name and value isn't passed also as a discrete parameter in the > > request parameter map? > > > Should not repeat your argument anyways if you're using some Stipes API > (RediretcResolution.addParameter, s:link, etc.) > > > Cheers > > > > This is past the URL building phase of the Stripes API. The URL is > correctly built as /action/1234 (where 1234 is bound to the field id). > When it goes through the interceptor it hits the above function. What > is happening is that req.getRequestURI() is returning /action/1234, > and then req.getParameter map also contains a key of id, with value of > 1234. The resultant url is then /action/1234?id=1234. > > > DMF is OK, the problem is your "getLastUrl" method : it concats the param > anyway, regardless of the URL binding... > > Check our how s:link does the job : it uses the UrkBinding info to recreate > correct URLs even with the "clean" URLs. > > Cheers > > Remi >
------------------------------------------------------------------------------ Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 _______________________________________________ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users