日期:2014-05-17 浏览次数:20804 次
function userLogin() {
var uname = document.getElementById("username").value;
var upwd = document.getElementById("password").value;
$.ajax({
type: "POST",
url: "login.do",
data: "username=" + uname + "&password=" + upwd,
success: function(result) {
},
error: function(result) {
alert("send false");
}
});
}
struts.xml部分代码
<package name="main" extends="struts-default">
<action name="index">
<result>index.jsp</result>
</action>
<action name="login" class="loginAction">
<result name="success">/home.jsp</result>
<result name="input">/index.jsp</result>
</action>
</package>
applicationContext.xml部分代码
<bean name="loginAction" scope="prototype" class="com.demo.actions.user.LoginAction">
<property name="userService">
<ref local="userService" />
</property>
</bean>