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
Ïà¹ØÎĵµ£º
public class TaskBean extends Thread{
public TaskBean(){
}
private int percent=0;
private boolean complete=false;
public synchronized&nb ......
JSP µÄÄÚÖöÔÏóÓУºresquest ¡¢response¡¢session¡¢ application ¡¢out¡£ÒÔÏÂÎÒÃǽ«
Ò»Ò»½éÉÜ¡£
response ºÍrequest ¶ÔÏóÊÇJSP µÄÄÚÖöÔÏó½ÏÖØÒªµÄÁ½¸ö£¬ÕâÁ½¸ö¶ÔÏóÌṩÁ˶ԷþÎñ
Æ÷ºÍä¯ÀÀÆ÷ͨÐÅ·½·¨µÄ¿ØÖÆ¡£Ö±½ÓÌÖÂÛÕâÁ½¸ö¶ÔÏóǰ£¬ÒªÏȶÔHTTP ÐÒé----Word Wide
Webµ×²ãÐÒé×÷¼òµ¥½éÉÜ¡£
Word Wide WebÊÇÔõÑùÔËÐеÄÄØ£ ......
HTML ×¢ÊÍ
ÔÚ¿Í»§¶ËÏÔʾһ¸ö×¢ÊÍ.
JSP Óï·¨
<!-- comment [ <%= expression %> ] -->
Àý×Ó 1
<!-- This file displays the user login screen -->
ÔÚ¿Í»§¶ËµÄHTMLÔ´´úÂëÖвúÉúºÍÉÏÃæÒ»ÑùµÄÊý¾Ý£º
<!-- This file displays the user login screen -->
Àý×Ó 2
<!-- This page was ......
JSP»ù±¾Óï·¨Ó붨Òå
ÏÈÀ´¿´Ò»¶Î¼òµ¥µÄС³ÌÐò£º
³ÌÐò£º
1.jsp
<html>
<head>
<title>example</title>
</head>
1
¡¡
<%@ page language=”java” %>
2
¡¡
<%@ page
contentType=”text/html,charset=”GB2312””>
3
¡¡ ......
Ëæ×ż¼ÊõµÄÈÕÐÂÔÂÒì £¬JSPµÄм¼ÊõÒ²²ã³ö²»ÇΪÁË·½Ãæ´ó¼ÒµÄѧϰÓ빤×÷£¬ÏÂÃæ½«¼òµ¥µÄ½éÉÜÒ»ÏÂJSP¼Ü¹¹¡¢JSP¿ª·¢¹¤¾ß¡¢Web·þÎñÆ÷¼°Æäîñȱµã¡£
JSP¼Ü¹¹£º
struts£º Struts¸úTomcat¡¢TurbineµÈÖî¶àApacheÏîĿһÑù£¬ÊÇ¿ªÔ´Èí¼þ£¬ÕâÊÇËüµÄÒ»´óÓŵ㣬ʹ¿ª·¢ÕßÄܸüÉ ......