This commit is contained in:
Keith Donald
2008-03-21 18:57:52 +00:00
parent 1a6cf956ee
commit 8d4ee1afb6
3 changed files with 85 additions and 0 deletions

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.springframework.webflow.context.servlet;
import java.io.UnsupportedEncodingException;
@@ -11,6 +26,36 @@ import org.springframework.web.util.UrlPathHelper;
import org.springframework.web.util.WebUtils;
import org.springframework.webflow.core.collection.AttributeMap;
/**
* The default flow url handler for Spring Web Flow.
* <p>
* Expects URLs to launch flow to be of this pattern:
*
* <pre>
* http://&lt;host&gt;/[app context path]/[app servlet path]/[namespace]/&lt;flow id&gt;
* </pre>
*
* For example:
*
* <pre>
* http://localhost/springtravel/app/booking
* </pre>
*
* Expects URLs to resume flows to be of this pattern:
*
* <pre>
* http://&lt;host&gt;/[app context path]/[app servlet path]/[namespace]/&lt;flow id&gt;?execution=&lt;flow execution key&gt;
* </pre>
*
* For example:
*
* <pre>
* http://localhost/springtravel/app/booking?execution=c1v1
* </pre>
*
* @author Keith Donald
*
*/
public class DefaultFlowUrlHandler implements FlowUrlHandler {
private static final String DEFAULT_URL_ENCODING_SCHEME = "UTF-8";

View File

@@ -1,9 +1,29 @@
/*
* Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.springframework.webflow.context.servlet;
import javax.servlet.http.HttpServletRequest;
import org.springframework.webflow.core.collection.AttributeMap;
/**
* A interface for parsing and generating flow URLs. Encapsulates a specific flow URL format.
*
* @author Keith Donald
*/
public interface FlowUrlHandler {
/**

View File

@@ -1,3 +1,18 @@
/*
* Copyright 2004-2008 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package org.springframework.webflow.context.servlet;
import java.io.UnsupportedEncodingException;
@@ -9,6 +24,11 @@ import javax.servlet.http.HttpServletRequest;
import org.springframework.webflow.core.collection.AttributeMap;
/**
* Flow URL handler that implements the default Web Flow 1.x URL format. Here for backwards compatibility.
*
* @author Keith Donald
*/
public class ParameterBasedFlowUrlHandler implements FlowUrlHandler {
private static final String DEFAULT_URL_ENCODING_SCHEME = "UTF-8";