问题?Ajax之在s2sh中的json用法
1.json.jar包的下载
在用Ajax的时候很多情况下我们需要将大量在集合中的数据传输到前端,这个时候就需要转化成json数据,但是三大框架没有自动转化成json数据的功能(基本类型除外)。就需要用到jar包
下载:点击打开链接
2.案例:
(1)前端Ajax:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'findManagers.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <meta http-equiv="Content-Type" content="text/jsp;charset=utf-8"> <script type="text/javascript" src="${pageContext.request.contextPath }/script/jquery/jquery-1.11.0.js"></script>