Announcement Announcement Module
Collapse
No announcement yet.
SWF2 externalRedirect fails on ajaxEvent Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SWF2 externalRedirect fails on ajaxEvent

    Since i cannot post any URLS in my first post, please refer to below post

  • #2
    SWF2 externalRedirect fails on ajaxEvent

    If i change booking-faces's main flow a bit
    Code:
    <view-state id="enterSearchCriteria">
    	<on-render>
    		<evaluate expression="bookingService.findBookings(currentUser.name)" result="viewScope.bookings" result-type="dataModel" />
    	</on-render>
    	<transition on="search" to="reviewHotels">
    		<evaluate expression="searchCriteria.resetPage()" />
    	</transition>
    	<transition on="cancelBooking">
    		<evaluate expression="bookingService.cancelBooking(bookings.selectedRow)" />
    		<render fragments="bookingsFragment" />
    	</transition>
    	<transition on="jump" to="jump"/>
    </view-state>
    <end-state id="jump" view="externalRedirect:http://www.springframework.org" />
    "jump" is generated from ajaxSource. I get an error and browser URL reads "http://localhost:8080//www.springframework.org"

    Is this a bug or is anything i've done causing this issue.

    My real world problem is, we need to trap onchange event from dropdown list box and based on the whats selected had either rerender fragments or redirect to new flow or external redirect. Stuck in external redirects.

    Any help greatly appreciated.
    Last edited by mohanraj; Feb 4th, 2009, 11:35 AM.

    Comment


    • #3
      I think you need:

      Code:
      <end-state id="jump" view="externalRedirect:serverRelative:http://www.springframework.org" />

      Comment


      • #4
        Originally posted by jonnio View Post
        I think you need:

        Code:
        <end-state id="jump" view="externalRedirect:serverRelative:http://www.springframework.org" />
        Thanks for your response. Though using serverRelative counters my understanding on that, I tried but the result is same.

        After some debug... I believe is issue is in handleResponse function in Spring-Dojo.js
        Code:
        if (redirectURL.indexOf("/") >= 0) {
        	window.location = window.location.protocol + "//" + window.location.host + redirectURL;
        }
        else {
        	var location = window.location.protocol + "//" + window.location.host + window.location.pathname;
        	var appendIndex = location.lastIndexOf("/");
        	location = location.substr(0,appendIndex+1) + redirectURL;
        	if (location == window.location) {
        		Spring.remoting.getResource(location, ioArgs.args.content, false);
        	}
        	else {
        		window.location = location;
        	}
        }
        return response;
        When returnURL is absolute URL for example "http://www.springframework.com" that if statement results true and window location will be set to "http://localhost:8080/http://www.springframework.com"

        I think it is a bug. I'll wait for some more responses before posting in Jira

        Comment


        • #5
          Quote from reference:

          10.4. Implementing custom FlowHandlers
          ...
          FlowHandler Redirects
          ...
          These same redirect prefixes are also supported within a flow definition when using the externalRedirect: directive in conjunction with a view-state or end-state; for example, view="externalRedirect:http://springframework.org"
          If this doesn't work, then this is definitely a bug.

          Comment


          • #6
            Originally posted by Hedin View Post
            If this doesn't work, then this is definitely a bug.
            Thanks for your response.
            I added this to Jira http://jira.springframework.org/browse/SWF-1033.

            A minor enhanced I wish could be added
            • Serving uncompressed javascript in development mode

            Comment

            Working...
            X