我的 struts.xml 部分
<action name="viewall" class="com.abc.csm.actions.GetAllConfiguration">
<result name="success">/success.jsp</result>
</action>
在 Welcome.jsp 的页面加载上,我调用了一个函数,该函数getXml()
应该接收 xml 作为响应,但我得到的是success.jsp
内容
function getXml()
{
var url_action="/csm/viewall.action";
var client;
var dataString;
if (window.XMLHttpRequest){
client=new XMLHttpRequest();
} else {
client=new ActiveXObject("Microsoft.XMLHTTP");
}
client.onreadystatechange=function(){
if(client.readyState==4&&client.status==200)
{
alert(client.responseText); /* here i want to get the actual response i.e., my xml. I am also using fiddler to monitor. */
}
};
dataString="projectid=1-105101";
client.open("POST",url_action,true);
client.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
client.send(dataString);
}