所以我得到了这个奇怪的错误,也许我错过了某些东西,
我有这个js脚本:
function openStationLoadWindow(inStationString) {
theStationString = inStationString;
$.ajax( {
url : "Ajax.faces?popup=true",
type : "GET",
cache : false,
contentType : 'application/json; charset=utf-8',
data : {
action : "retrieveStnLoadWindow",
selectedStations : theStationString
},
并且在ajax处理程序中我试图获取选定的电台:
String theStationString = itsContext.getExternalContext().getRequest().getParameter( "selectedStations" );
theStationString为空。但是当我在js部分附加一个字符串时:
function openStationLoadWindow(inStationString) {
**theStationString = inStationString + "ANY";**
$.ajax( {
url : "Ajax.faces?popup=true",
type : "GET",
cache : false,
contentType : 'application/json; charset=utf-8',
data : {
action : "retrieveStnLoadWindow",
selectedStations : theStationString
},
String theStationString = itsContext.getExternalContext().getRequest().getParameter( "selectedStations" );
我能够获得theStationString +" ANY"。
有什么想法吗?