Ext+json+jsp¹¹½¨µÄ¶¯Ì¬Ê÷
Ê÷½Úµã×éºÏÄ£ÐÍ
package cn.com.jsnh.model.catalog;
public class TreeModel {
private String node;
private CatalogModel model;
public String getNode() {
return node;
}
public void setNode(String node) {
this.node = node;
}
public CatalogModel getModel() {
return model;
}
public void setModel(CatalogModel model) {
this.model = model;
}
}
À¸Ä¿Ä£ÐÍ¡¾Êµ¼ÊµÄÊ÷½Úµã¡¿
package cn.com.jsnh.model.catalog;
public class CatalogModel {
private String id;
private String text;
private Boolean leaf;
private String cls;
private String action;
private String model;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public Boolean getLeaf() {
return leaf;
}
public void setLeaf(Boolean leaf) {
this.leaf = leaf;
}
public String getCls() {
return cls;
}
public void setCls(String cls) {
this.cls = cls;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getModel() {
return model;
}
public void setModel(String model) {
this.model = model;
}
}
<%@ page import="java.util.*,
cn.com.jsnh.model.catalog.TreeModel,
cn.com.jsnh.model.catalog.CatalogModel,
net.sf.json.JSONObject,
net.sf.json.JSONArray,
net.sf.ezmorph.bean.MorphDynaBean"
contentType="text/html;charset=utf-8"%>
<%
try{
String node = request.getParameter("node");
System.out.println("node="+node);
List<TreeModel> tree = new ArrayList<TreeModel>();
TreeModel treeModel = new TreeModel();
CatalogModel catalogModel = new CatalogModel();
catalogModel.setId("100000");
catalogModel.setText("¸öÈ˹ÜÀíרÇø");
catalogModel.setLeaf(Boolean.FALSE);
catalogModel.setCls("folder");
catalogModel.setAction("100000");
catalogModel.setModel("100000");
treeModel.setNode("root");
treeModel.setModel(catalogModel);
tree.add(treeModel);
treeModel = new TreeM
Ïà¹ØÎĵµ£º
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servle ......
<%@ page language="java" import="java.util.*" pageEncoding="GB2312"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>index</title>
<meta http-equiv="pragma" content="no-cache"&g ......
ÕâÊÇÒ»¸öÓû§×¢²áµÄÒ³Ã棬²¿·Ö´úÂ루ûÓдíÎó£©ÒÑÂÔ£¬¿ÉÊDz»ÄÜʵÏÖformµÄactionÌøת
checkform()ÀïÃ÷Ã÷ÓÐdocument.form.submit()£¬¾ÍÊDz»ÄÜÌøת£¬
ÄÜ°ïÎÒ¿´ÏÂÎÊÌâ³öÔÚÄÄÂð£¿
ÕâÊÇÕÕ×ÅÊéÉϵÄÀý×ÓдµÄ£¬×¢²áºÍÖØÖö¯¶¼×÷ÊÇͨ¹ýͼƬÀ´´¦ÀíµÄ¡£
Çë²»Áߴͽ̣¬ÔÚϲ»Ê¤¸Ð¼¤¡£¡£¡£
<%@ page contentType="te ......
¶ÔÓÚHTMÍøÒ³£¬¼ÓÈ룺
<meta HTTP-EQUIV="pragma" CONTENT="no-cache">
<meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<meta HTTP-EQUIV="expires" CONTENT="0">
È»ºó£¬jspÒ³ÃæÖмÓÈ룺
<%
response.setHeader("Cache-Control","no-store") ......
javascriptдjavaû¹Øϵ,ÖÁÓÚΪʲôÃû×ÖÕâôÏà½ü,¿ÉÄÜÊÇÒòΪjavaºÜÓÐÃûÆøËùÒÔ°ÑÃû×ÖÈ¡³É²î²»¶àµÄ,Ò»ÖÖÐÂÓïÑÔ¸Õ³öÀ´µÄʱºòÒªµãÃûÆøÀ´³öÃû°É~~
javascriptËãÊÇÒ»ÖÖhtml½Å±¾ÄÜÖ±½ÓÖ´ÐеÄÓïÑÔ°É,jspÒª±àÒë²ÅÄÜÖ´ÐÐ,Äã×Ô¼ºÐ´¸öJSP²»¿ªtomcatÖ®ÀàµÄÊÇÎÞ·¨Ö´ÐеÄ.JSPºÍJAVAµÄÇø±ð,JSPËãÊÇJAVAÒ»ÖÖ¼¼Êõ°É,ÓÃÔÚÍøÒ³±à³ÌÉÏ,ÒòΪJAVA² ......