Results 1 to 2 of 2

Thread: Mobile Path and Root Path not working as expected

  1. #1
    Join Date
    Dec 2012
    Posts
    1

    Default Mobile Path and Root Path not working as expected

    I have a little problem with
    webmvc_config.xml
    <bean class="org.springframework.mobile.device.site.Site PreferenceHandlerInterceptor" />

    <!-- On pre-handle, redirects mobile users to "StayAt.org/taxi/mob" (declare after DeviceResolverHandlerInterceptor) -->
    <bean class="org.springframework.mobile.device.switcher. SiteSwitcherHandlerInterceptor" factory-method="urlPath">
    <constructor-arg index="0" type="java.lang.String" value="/mob" />
    <constructor-arg index="1" type="java.lang.String" value="/taxi" />
    </bean>
    web.xml
    <servlet-mapping>
    <servlet-name>taxi</servlet-name>
    <url-pattern>/</url-pattern>
    <url-pattern>/mob/*</url-pattern>
    </servlet-mapping>
    HelloController
    strCurrentSitePreference = request.getParameter("site_preference");
    if (strCurrentSitePreference == null) {
    Device device = DeviceUtils.getCurrentDevice(request);
    // System.out.println("***** org.stayat.web.util.HelloController.isbNormal ***** device "+ device+ " device.isMobile() "+ device.isMobile());
    if (device.isMobile()) {
    bNormal = false;
    strCurrentSitePreference = "mobile";
    strTemp = "mobile";
    } else {
    bNormal=true;
    strCurrentSitePreference = "normal";
    strTemp = "normal";
    }
    }else{
    if (strCurrentSitePreference.equals("mobile")) {
    bNormal = false;
    strCurrentSitePreference = "mobile";
    strTemp = "mobile";
    } else {
    bNormal=true;
    strCurrentSitePreference = "normal";
    strTemp = "normal";
    }
    }
    main.jsf
    I have to maintain a separate panel (rendered="#{!helloController.bNormal}") instead of redirecting to a other page e.g. mobile/main.jsf mob.jsf
    did I oversee something in the documentation?
    thanks for your help
    Last edited by bussien; Mar 21st, 2013 at 11:33 AM.

  2. #2
    Join Date
    Nov 2010
    Posts
    175

    Default

    I'm having trouble understanding the issue. Can you describe what is happening, and what are your expectations? Thanks!
    Roy Clarkson
    Spring Mobile Projects Lead

Tags for this Thread

Posting Permissions

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