View Full Version : The StandardSiteUrlFactory and query parameter
shahbazi
Dec 11th, 2010, 02:03 AM
Currently, the StandardSiteUrlFactory class doesn't append the query parameter into the newly created url!
Another suggestion, Add new attribute (e.g. mParameter,mParamValue) to the SiteSwitcherHandlerInterceptor.java which supports cases then mobile site is based on the query parameter.
For example for testdomain.com it redirects to testdomain.com?${mParameter}=${mParamValue}
//
Reza
Keith Donald
Dec 11th, 2010, 08:45 AM
Well, lets step back a little bit and explain your requirement. Resources typically should not be identified by query parameter values, they should are addressed by a request URI. So I'm not sure preserving parameters through the redirect is ideal here, honestly (sending the site_preference parameter through the redirect is definitely not ideal, after it's already stored in the cookie).
To your second point: why aren't cookies good enough? Do you really want to rely on a query parameter to be present on every request to force the mobile site? Wouldn't you have to rewrite each URL generated by your view templates with site_preference=mobile then?
Keith
shahbazi
Dec 11th, 2010, 05:16 PM
for usecase 2,
1) for case of web applications, IMHO, it is not a good practice to hard code the site names (e.g testdomain.com, m.testdomain.com) into the web application. may this is fine for web sites.
We usually delivery the web.war to our clients and it supports both browser based and mobile based agents. The context root is alway relative path. http://localhost:8080/web is for browsers and http://localhost:8080/web/*?m=true is the mobile version; as well as cookie store.
Keith Donald
Dec 16th, 2010, 10:23 AM
How do you handle encoding the m=true parameter value into every link rendered on a mobile page?
Also, how do you handle the case where a mobile user types in one of your URLs without including the m=true parameter?
Keith
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.