Spring 网络流量动态 url

Spring web flow dynamic url

我正在学习使用 Spring Webflow。我已经有一个工作流程,我在其中创建了一个老式安装程序,用户在其中创建了一个 configuration 对象。这是按预期工作的。现在,我想要做的是让编辑 configuration 对象成为可能。为此,我需要将此流程传递给选定的配置对象。我认为最好的方法是将一个 id 传递给 webflow,并在服务的帮助下将其设置为流变量。我的问题是如何创建此 url 映射。

这是此流的当前 url 映射:

 <bean id="flowMappings" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <value>/configuration=configController</value>
        </property>
    </bean>

是否可以这样做:

<bean id="flowMappings" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <value>/{id}/configuration=configController</value>
        </property>
    </bean>

非常感谢任何帮助。

好的,我有办法了。

我写在这里以防以后有人遇到类似的问题。

所以我不需要上述任何配置,因为在流配置 xml 中可以定义一个 input。例如你想查询一个 configurationId 那么你可以通过以下方式来做:

假设您有以下流程 url:http://localhost/flow

然后你可以像这样将参数传递给 flow.xml:http://localhost/flow?configurationId=1。 要传递它,您必须在流配置中定义一个 input,如下所示:<input name="configurationId"/>

还有你的 id 你可以为此创建一个服务 return 一个具体的对象。