spring-mobile-device

org.springframework.mobile.device.switcher
Interface SiteUrlFactory

All Known Implementing Classes:
AbstractSitePathUrlFactory, AbstractSiteUrlFactory, MobileSitePathUrlFactory, NormalSitePathUrlFactory, StandardSiteUrlFactory

public interface SiteUrlFactory

Strategy for constructing different site URLs, such as the 'mobile' site URL.

Author:
Keith Donald

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.
 

Method Detail

isRequestForSite

boolean isRequestForSite(javax.servlet.http.HttpServletRequest request)
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.

See Also:
SiteSwitcherHandlerInterceptor.preHandle(HttpServletRequest, javax.servlet.http.HttpServletResponse, Object)

createSiteUrl

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. A typical implementation changes the target host but preserves the request path.


spring-mobile-device