ajax在easyui中使用实例
来源:互联网 发布:淘宝可以不提供发票吗 编辑:程序博客网 时间:2024/06/05 16:58
<td align="center" valign="middle" class="shimingrenz" ><a href="javascript:void(0);" style="text-decoration:none;color:#ffffff;" onClick="recognize()" >立即申请</a></td>
<script type="text/javascript">function recognize(){ url = "recognizeUser"; var result = $.ajax({ url:url, dataType:"html", /* data:{userName : userName}, */ async:false, type:"get" }).responseText; Json = eval("(" + result + ")");//将字符串转为实际的对象 if(Json.user=="none") { window.open('https://localhost:8443/healthcloudpro/manager/subsystem/main/authShow.jsp'); } else if(Json.rows[1].value==null) { /* 没有通过验证且没有上传过信息 */ window.open('https://localhost:8443/healthcloudpro/manager/subsystem/main/Authentic.jsp'); } else window.open('/healthcloudpro/manager/subsystem/main/authRemind.jsp'); }</script>
@Action(value = "/recognizeUser", results = { @Result(name = SUCCESS, location = "/manager/subsystem/main/sucess.jsp")}) public String reco() { HttpServletRequest request = ServletActionContext.getRequest(); HttpServletResponse response = ServletActionContext.getResponse(); HttpSession session = request.getSession(true); String s =(String) session.getAttribute("userid"); if(s==null) { String user="none"; String str = "{\"user\":\""+user+"\"}"; PrintWriter out; try { out = response.getWriter(); out.println(str.toString());System.out.println("str"); out.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); return "fail"; } return SUCCESS; } int userid = Integer.parseInt(s); Userinfo userinfo = (Userinfo)userinfoService.findByUserid(userid); Map map = new HashMap(); ArrayList al = new ArrayList(); Map auth = new HashMap(); auth.put("name", "isAuth"); auth.put("value", userinfo.getUserUuid()); Map idtype = new HashMap(); idtype.put("name", "idtype"); idtype.put("value", userinfo.getIdtype()); Map authfail = new HashMap(); authfail.put("name", "isAuthfail"); authfail.put("value", userinfo.getAuthenFail()); al.add(auth); al.add(idtype); al.add(authfail); map.put("total", 1); map.put("rows", al); resultObj=JSONObject.fromObject(map); //将map对象转换成为json对象 System.out.println(resultObj); PrintWriter out; try { out = response.getWriter(); out.println(resultObj); out.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); return "fail"; } return SUCCESS; }
0 0
- ajax在easyui中使用实例
- EasyUI中使用Ajax提交文件表单
- 在ASP.NET中使用无框架的Ajax实例
- 在ASP.NET中使用无框架的Ajax实例
- 在easyui的框架中,使用ajax实现批量上传图片到服务器
- EasyUI中Accordion使用的代码实例
- easyui中ajax笔记
- 在easyui DataGrid 中使用 linkbutton
- Python3,在Django中使用easyui
- EasyUI使用实例
- easyUI使用实例讲解
- easyui tips使用实例
- 在Liferay中使用Ajax
- 在vs2008中使用AJAX
- 在JQ中使用Ajax
- 在vue2中使用ajax
- 在strus2中使用ajax
- EasyUI中calender控件使用的代码实例
- 获取某条新浪微博的所有转发用户列表(使用repost_timeline接口)
- IOS 之 NSBundle 使用
- Mysql server has gone away
- jquery选择器
- 百度云推送sdk集成问题
- ajax在easyui中使用实例
- iPhone应用开发 UITableView学习点滴详解
- 设备驱动(九)
- Linux 脚本编写基础
- Redis实现分布式全局锁
- 关于UILabel的多行显示 UILabel numberOfLines
- AudioRecord 使用小结与注意事项
- (转)关于WakeLock和省电的硬件研究
- 中国富人欲起诉加拿大政府:切断投资移民不公平