Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在Spring WebFlow中重定向/转发到子域_Java_Spring_Spring Webflow 2 - Fatal编程技术网

Java 在Spring WebFlow中重定向/转发到子域

Java 在Spring WebFlow中重定向/转发到子域,java,spring,spring-webflow-2,Java,Spring,Spring Webflow 2,我有一个JavaSpringWebFlow应用程序,它需要重定向到它自己的子域以供选择语言。i、 从e.mysite.com到fr.mysite.com 我尝试了externalRedirect,但只显示了一个空白的html页面 以下是webflow防御代码段: <transition on="found" to="redirectOnRetrieve"> <evaluate expression="retrieveController.getFoun

我有一个JavaSpringWebFlow应用程序,它需要重定向到它自己的子域以供选择语言。i、 从e.mysite.com到fr.mysite.com

我尝试了externalRedirect,但只显示了一个空白的html页面

以下是webflow防御代码段:

<transition on="found" to="redirectOnRetrieve">         
    <evaluate expression="retrieveController.getFoundApplicationRedirect(flowRequestContext)" result="flowScope.redirectUrl"/> 
</transition>

它决定了我需要重定向到的URL。以下是带有externalRedirect的视图状态:

<view-state id="redirectOnRetrieve" view="externalRedirect:${flowScope.redirectUrl}"/>


也可以将请求参数附加到URL吗?

我设法实现了我想要的。在webflow中重定向到子域。这就是我如何让它工作的

因此,在流定义中,我有:

<transition on="found" to="redirectOnRetrieve">         
    <evaluate expression="retrieveController.brokerApplicationRedirect(flowRequestContext)"/> 
</transition>

因此,我以任何方式构建Url字符串,然后在控制器中执行重定向

在flow.xml中,正确的EL语法是
#{flowScope.redirectUrl}
,而不是
${flowScope.redirectUrl}

您不能将它们附加到
flowScope.redirectUrl
?出于某种原因,我不能。如果我尝试从流定义中执行externalRedirect,它将永远无法工作。没有给出错误,将保持在同一页上,没有重定向完成。不过我确实找到了一个方法,很快就会发布。
   public void brokerApplicationRedirect(RequestContext context) throws IOException, ServletException {
        String urlString = "http://sub.domain.com?param=myparam";        
        context.getExternalContext().requestExternalRedirect(urlString);
    }