maximizable:false,//禁止最大化
closeAction:\'close\',
closable:false,//禁止关闭
collapsible:true,//可折叠
plain: true,
buttonAlign:\'center\',
items:simple//将表单作为窗体元素嵌套布局
});
win.show();//显示窗体
});
</script>
</body>
</html>
------------------------------------------------------------------------
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
// 初始化编码方式和输出流
response.setContentType("text/json; charset=utf-8");
PrintWriter out = null;
try {
out = response.getWriter();
} catch (IOException e) {
e.printStackTrace();
}
// 得到页面传过来的参数
String username = request.getParameter("name");
String password = request.getParameter("pws");
System.out.println("用户名:" + username);
System.out.println("密码:" + password);
// 请求判断
String msg = null;
if (username.trim().equals("admin") && password.trim().equals("123")) {
msg = "ok";
} else {
msg = "你的帐户或密码错误";
}
// 初始化
Map map = new HashMap();
map.put("success", true);
map.put("msg", msg);
// 转换成对象,不要转换成数组
JSONObject obj = JSONObject.fromObject(map);
//
System.out.println(obj);
// 输出到列表
out.print(obj);
return null;
}
声明:本站教程文章版权为一起Ext(http://www.17ext.com/)所有,转载请注明出处