Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-942

incorrect flowExecutionUrl if httpsession is url-rewrite-based (f.e. if you disable browser cookies)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Invalid
    • Affects Version/s: 2.0.3
    • Fix Version/s: None
    • Component/s: Core: Flow Executor
    • Labels:
      None

      Description

      If browser cookies are disabled, the flowExecutionUrl delivered by org.springframework.webflow.context.servlet.DefaultFlowUrlHandler doesn't include the ";jsessionid", so the flow is restarted every time...

      as work around we override createFlowExecutionUrl in our flowHandler like this:

          @Override
          public String createFlowExecutionUrl(String flowId, String flowExecutionKey, HttpServletRequest request) {
          	String url = super.createFlowExecutionUrl(flowId, flowExecutionKey, request);    	
          	if (!request.isRequestedSessionIdFromCookie()){
          		if (!url.contains(";jsessionid")){
          			String sessionId = request.getRequestedSessionId();
          			if (sessionId != null){
      	    			StringBuffer sb = new StringBuffer();
      	    			StringTokenizer st = new StringTokenizer(url, "?");
      	    			sb.append(st.nextToken());
      	    			sb.append(";jsessionid").append("=").append(sessionId);
      	    			if (st.hasMoreTokens()){
      	    				sb.append("?").append(st.nextToken());
      	    			}
      	    			url = sb.toString();
          			}
          		}
          	}
          	
          	return url;
          }
      
      

        Attachments

          Activity

            People

            Assignee:
            sandrews Scott Andrews
            Reporter:
            dietertengelmann Dieter Tengelmann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: