spring-mobile-device

org.springframework.mobile.device.switcher
Class MobileSitePathUrlFactory

java.lang.Object
  extended by org.springframework.mobile.device.switcher.AbstractSiteUrlFactory
      extended by org.springframework.mobile.device.switcher.AbstractSitePathUrlFactory
          extended by org.springframework.mobile.device.switcher.MobileSitePathUrlFactory
All Implemented Interfaces:
SiteUrlFactory

public class MobileSitePathUrlFactory
extends AbstractSitePathUrlFactory
implements SiteUrlFactory

Path based site URL factory implementation that handles requests for the "mobile" site.

Author:
Scott Rossillo, Roy Clarkson

Constructor Summary
MobileSitePathUrlFactory(java.lang.String mobilePath)
          Creates a new mobile site path URL factory.
MobileSitePathUrlFactory(java.lang.String mobilePath, java.lang.String rootPath)
          Creates a new mobile site path URL factory.
 
Method Summary
 java.lang.String createSiteUrl(javax.servlet.http.HttpServletRequest request)
          Create a fully-qualified URL that can be used to redirect the user to this site.
 boolean isRequestForSite(javax.servlet.http.HttpServletRequest request)
          Did the request originate from this site? Used to determine what site the user is currently viewing.
 
Methods inherited from class org.springframework.mobile.device.switcher.AbstractSitePathUrlFactory
getCleanMobilePath, getFullMobilePath, getMobilePath, getRootPath
 
Methods inherited from class org.springframework.mobile.device.switcher.AbstractSiteUrlFactory
createSiteUrlInternal, optionalPort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MobileSitePathUrlFactory

public MobileSitePathUrlFactory(java.lang.String mobilePath)
Creates a new mobile site path URL factory.


MobileSitePathUrlFactory

public MobileSitePathUrlFactory(java.lang.String mobilePath,
                                java.lang.String rootPath)
Creates a new mobile site path URL factory.

Method Detail

isRequestForSite

public boolean isRequestForSite(javax.servlet.http.HttpServletRequest request)
Description copied from interface: SiteUrlFactory
Did the request originate from this site? Used to determine what site the user is currently viewing. For example, if the user is viewing a page on "m.app.com", this method would likely return 'true' if it constructs m.app.com URLs. The SiteSwitcherHandlerInterceptor uses this knowledge to implement its switching algorithm.

Specified by:
isRequestForSite in interface SiteUrlFactory
See Also:
SiteSwitcherHandlerInterceptor.preHandle(HttpServletRequest, javax.servlet.http.HttpServletResponse, Object)

createSiteUrl

public java.lang.String createSiteUrl(javax.servlet.http.HttpServletRequest request)
Description copied from interface: SiteUrlFactory
Create a fully-qualified URL that can be used to redirect the user to this site. A typical implementation changes the target host but preserves the request path.

Specified by:
createSiteUrl in interface SiteUrlFactory

spring-mobile-device