send_request("post","mc.jsp?keyWord="+keyword+"&type="+type+"&="+,null,"text",processTextResponse);
请求页面为mc.jsp;
mcjsp:<%@ include file="pageFunctionPopedom.jsp"%>
我在pageFunctionPopedom.jsp页面throw new Exception("页面已过期!");
可是AJAX不会理会这个异常得到的:readyState为4,status为200.怎么捕获到pageFunctionPopedom.jsp抛出的异常呢?
请求页面为mc.jsp;
mcjsp:<%@ include file="pageFunctionPopedom.jsp"%>
我在pageFunctionPopedom.jsp页面throw new Exception("页面已过期!");
可是AJAX不会理会这个异常得到的:readyState为4,status为200.怎么捕获到pageFunctionPopedom.jsp抛出的异常呢?
send_request("post","mc.jsp?keyWord="+keyword+"&type="+type+"&="+,null,"text",processTextResponse);
}catch(e){
alert(e);
}
一般是这样,java层抛出异常以后,catch里面将异常信息放到request,js从request获取返回,来判断调用到的java层有无异常
<message><status>succ( or fail )</status><data>cont of ur data ( or failure message)</data></message>
另外异常处理也不应该由jsp抛出
if(xml_http_request.status==200)
{
}else{
history.go(0);
}