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 ......
JSP/Servlet的编码原理
关键字: jsp, servlet编码
首先,说说 JSP/Servlet 中的几个编码的作用
在 JSP/Servlet 中主要有以下几种设置编码的方式:
pageEncoding ="UTF-8"
contentType = "text/html;charset=UTF-8"
request.setCharacterEncoding("UTF-8")
response.setCharacterEncodin ......
JSP中可能会碰到的问题解答
来源:不详 作者:佚名 更新时间: 2009年07月02日 点击:
JSP中可能会碰到的问题解答
1、如何混合使用Jsp和SSI #include?
在JSP中可以使用如下方式包含纯HTML:
< !--#include file="data.inc"-- >
但是如果data.inc中包含JSP CODE ,我们可以使用:
< %@include file= ......
<%@ page contentType="text/html;charset=GBK"%>
<%@page import="java.util.*"%>
<%@page import="java.io.*" %>
<%
//在这里如果写成“WEB-INF\templates\template.htm”程序会报错
String filePath = request.getRealPath("/")+"WEB-INF/templates/template.htm"; &nbs ......