Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/304.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 通过下拉菜单更改语言时,如何保留所有当前GET请求参数?_Java_Jsf_Jsf 2 - Fatal编程技术网

Java 通过下拉菜单更改语言时,如何保留所有当前GET请求参数?

Java 通过下拉菜单更改语言时,如何保留所有当前GET请求参数?,java,jsf,jsf-2,Java,Jsf,Jsf 2,我有一个页面,它通过点击一个链接调用一个方法,做一些工作,并将字符串作为输出传递,以便显示另一个页面 public String doTheMagic() { // I'm doing the magic here. Once my magic is done, return to the next page // with return String so the other page can be displayed. return "../content/cate

我有一个页面,它通过点击一个链接调用一个方法,做一些工作,并将字符串作为输出传递,以便显示另一个页面

public String doTheMagic() {
    // I'm doing the magic here. Once my magic is done, return to the next page 
    // with return String so the other page can be displayed.
    return "../content/categoryview.jsf?cat="+e.getNewValue().toString()";
}
到目前为止一切都很好

我的标题上有一个下拉菜单,可以将语言从英语改为法语。我的问题是,当我在该页面上更改语言时,
。/content/categoryview.jsf?cat=3
,并将该页面更改为
。/content/categoryview.jsf
。它会下降
?cat=3
。当重新显示页面并且没有
?cat=3
时,它抛出以下异常

java.lang.NumberFormatException: null
有没有办法改变我的语言并保持我的URL不变