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不变