level 1
呆一边凉快去
楼主
js文件中使用$.post url 写成 houseInfo的时候,不能跳转到HouseInfoAction;然而 改成 login,就可以跳转到LoginAction。
这是为什么,求解释
js文件
function selectPageInfo(pageNow,pageSize){
var pageNow = pageNow;
var pageSize = pageSize;
$.post("houseInfo",
{flag:"selectPageInfo", pageNow:pageNow, pageSize:pageSize},
function(data){
if(data == "1"){
location.reload()
return
}
});
}
LoginStruts.xml
<struts>
<package name="loginActions" namespace="/" extends="struts-default">
<action name="login" class="com.houseRentingSystemOfSSH.action.LoginAction">
<!-- 常用result type: dispatcher:forword,redirect:客户端跳转(url显示的是jsp) chain和redirectAction:可以跳转到action -->
<result name="loginAdminSuccess" >/admin/index.jsp</result>
<result name="loginAdminErr" >/admin/login.jsp</result>
</action>
</package>
</struts>
HouseInfoStruts.xml
<struts>
<package name="houseInfoActions" namespace="/" extends="struts-default">
<action name="houseInfo" class="com.houseRentingSystemOfSSH.action.HouseInfoAction">
</action>
</package>
</struts>
Struts.xml
<struts>
<constant name="struts.i18n.encoding" value="GBK" />
<constant name="struts.objectFactory" value="spring" />
<include file="LoginStruts.xml" />
<include file="HouseInfoStruts.xml" />
<include file="UserInfoStruts.xml" />
</struts>
2016年08月06日 12点08分
1
这是为什么,求解释
js文件
function selectPageInfo(pageNow,pageSize){
var pageNow = pageNow;
var pageSize = pageSize;
$.post("houseInfo",
{flag:"selectPageInfo", pageNow:pageNow, pageSize:pageSize},
function(data){
if(data == "1"){
location.reload()
return
}
});
}
LoginStruts.xml
<struts>
<package name="loginActions" namespace="/" extends="struts-default">
<action name="login" class="com.houseRentingSystemOfSSH.action.LoginAction">
<!-- 常用result type: dispatcher:forword,redirect:客户端跳转(url显示的是jsp) chain和redirectAction:可以跳转到action -->
<result name="loginAdminSuccess" >/admin/index.jsp</result>
<result name="loginAdminErr" >/admin/login.jsp</result>
</action>
</package>
</struts>
HouseInfoStruts.xml
<struts>
<package name="houseInfoActions" namespace="/" extends="struts-default">
<action name="houseInfo" class="com.houseRentingSystemOfSSH.action.HouseInfoAction">
</action>
</package>
</struts>
Struts.xml
<struts>
<constant name="struts.i18n.encoding" value="GBK" />
<constant name="struts.objectFactory" value="spring" />
<include file="LoginStruts.xml" />
<include file="HouseInfoStruts.xml" />
<include file="UserInfoStruts.xml" />
</struts>