AJAX
AJAX 是一种在无需重新加载整个网页的情况下,能够更新部分网页的技术。
通过在后台与
传统的网页(不使用 AJAX)如果需要更新内容,必须重载整个网页页面。
JSON
JSON(JavaScript Object Notation, JS 对象标记) 是一种轻量级的数据交换格式。它基于 E
利用Ajax将json数据传值到JSP
第一步:在你的Action中创建一个json数据
public class AjaxAction extends ActionSupport{ /** * */ private static final long serialVersionUID = 1L; private String result; public String getResult() { return result; } public void setResult(String result) { this.result = result; } public String getjson() { JSONObject json = new JSONObject(); json.put("name","张三"); json.put("password","123456"); result=json.toString(); return SUCCESS; }
第二步:编写struts.xml文件中的内容
—-想了解更多的jsp相关干货教程关注
本文来自网络收集,不代表猴子技术宅立场,如涉及侵权请点击右边联系管理员删除。
如若转载,请注明出处:https://www.ssfiction.com/jsjc/111789.html