Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.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中,如何设置hashmap以附加查询字符串?_Spring_Redirect_Map_Query String - Fatal编程技术网

在Java/Spring中,如何设置hashmap以附加查询字符串?

在Java/Spring中,如何设置hashmap以附加查询字符串?,spring,redirect,map,query-string,Spring,Redirect,Map,Query String,在spring config/applicationContext mapping.xml中: 我有一段代码: <bean id="unused-url-quick" class="java.util.HashMap"> <constructor-arg> <map> <entry key="/page.html" value="/otherpage.html"/> ...

在spring config/applicationContext mapping.xml中:

我有一段代码:

<bean id="unused-url-quick" class="java.util.HashMap">
    <constructor-arg>
    <map>
          <entry key="/page.html" value="/otherpage.html"/>
            ...
        </map>

...
我可以添加一个条目键以从一个页面重定向到另一个页面

使用相同的方法如何将querystring参数传递给otherpage.html

<bean id="unused-url-quick" class="java.util.HashMap">
    <constructor-arg>
    <map>
      <entry key="/page.html?qs=1" value="/otherpage.html?qs=1"/>
        ...
    </map>

...

…查询字符串key=value对在哪里变化?

这不是在Spring级别完成的。

在哪里使用此映射?作为某些视图解析器/控制器的一部分?如果它是Spring提供的标准解析器之一,那么是哪一个呢?我相信这是为了查看解析器,我不知道任何Spring内置的解析器会做这样的事情;这是习俗吗?如果是这样的话,那就是你需要寻找答案的地方——问题不在于如何在映射中指定查询参数,而在于如何在视图解析器中处理它们。我仍在尝试展开/剖析此处的系统设置,以了解其工作原理是如何为答案保留的,请在适当的情况下使用添加注释