Results 1 to 4 of 4

Thread: The StandardSiteUrlFactory and query parameter

  1. #1
    Join Date
    Mar 2005
    Location
    Los Angeles
    Posts
    20

    Default The StandardSiteUrlFactory and query parameter

    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

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    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
    Keith Donald
    Core Spring Development Team

  3. #3
    Join Date
    Mar 2005
    Location
    Los Angeles
    Posts
    20

    Default

    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.

  4. #4
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    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
    Last edited by Keith Donald; Dec 16th, 2010 at 11:09 AM.
    Keith Donald
    Core Spring Development Team

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •