<script type="text/javascript">
$("#commit").click(function(){
var name =$("#name").val();
var password = $("#password").val();
debugger;
if(name =='admin'&&password =='ehouse'){
$.get("<%=basePath%>admin/login.html");
}else{
alert("用户名或密码不正确");
}
});
</script>
@Controller
@RequestMapping(value = "/admin/")
public class AdminController {
@RequestMapping(value = "/login")
public ModelAndView index(HttpServletRequest request)throws SQLException {
ModelAndView view = new ModelAndView("index");
return view;
}
}
$.get()不是获取数据吗
跳转页面你可以使用 location.href=... 或者 window.open()