新手出道! 学习了SSH 和 Extjs,但在整合的问题一直弄不明白
各种Extjs配置项让人头晕
我在浏览器载入网页的时候,后台服务的execute()被调用,并且输出了
********访问前********
********访问后********
但是我前台看不到数据id,name,和password
求高手解惑 :麻烦指出原因后!并能直接给出修改后的代码 谢谢 !!!!!
求高手解惑 :麻烦指出原因后!并能直接给出修改后的代码 谢谢 !!!!!
求高手解惑 :麻烦指出原因后!并能直接给出修改后的代码 谢谢 !!!!!不胜感激!
Action类 :
public class ExtjsAction extends ActionSupport{
private int id;
private String name;
private String password;
public String execute() throws Exception {
System.out.println("********访问前********");//检测extjs前端的函数不是不访问改action
this.id = 5;
this.name = "chenwei";
this.password = "123456";
System.out.println("********访问后********");//检测extjs前端的函数不是不访问改action
return "success";
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}struts配置:
<struts>
<package name="default" namespace="/" extends="json-default">
<action name="json" class="com.extjs.action.ExtjsAction">
<result type="json" name="success">
<param name="includeProperties">id,name,password</param>
</result>
</action>
</package>
</struts>
Ext代码:
Ext.onReady(function(){
var user = Ext.data.Record.create([
{name:"id",mapping:"id"},
{name:"username",mapping:"name"},
{name:"password",mapping:"password"}
]);
//存储器
var vstore = new Ext.data.JsonStore({
autoDestory:true,
url:'json.action',
reader:new Ext.data.JsonReader({
root:"allUser",
id:"id",
totalProperty:"recordSize"
},user)
});
vstore.load();
var grid = new Ext.grid.GridPanel({
title:"administrator",
store:vstore,
columns:[
{header:"ID", dataIndex:"id",width:20},
{header:"username", dataIndex:"name",width:100},
{header:"password", dataIndex:"password",width:100}
]
});
new Ext.Viewport({
layout:"border",
items:[{
title:"AdminArea",
region:"north",
height:100
},{
region:"west",
title:"Function",
width:150,
split:true
},{
region:"center",
title:"MainArea",
id:"mainContent",
items:grid
}]
});
});
各种Extjs配置项让人头晕
我在浏览器载入网页的时候,后台服务的execute()被调用,并且输出了
********访问前********
********访问后********
但是我前台看不到数据id,name,和password
求高手解惑 :麻烦指出原因后!并能直接给出修改后的代码 谢谢 !!!!!
求高手解惑 :麻烦指出原因后!并能直接给出修改后的代码 谢谢 !!!!!
求高手解惑 :麻烦指出原因后!并能直接给出修改后的代码 谢谢 !!!!!不胜感激!
Action类 :
public class ExtjsAction extends ActionSupport{
private int id;
private String name;
private String password;
public String execute() throws Exception {
System.out.println("********访问前********");//检测extjs前端的函数不是不访问改action
this.id = 5;
this.name = "chenwei";
this.password = "123456";
System.out.println("********访问后********");//检测extjs前端的函数不是不访问改action
return "success";
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}struts配置:
<struts>
<package name="default" namespace="/" extends="json-default">
<action name="json" class="com.extjs.action.ExtjsAction">
<result type="json" name="success">
<param name="includeProperties">id,name,password</param>
</result>
</action>
</package>
</struts>
Ext代码:
Ext.onReady(function(){
var user = Ext.data.Record.create([
{name:"id",mapping:"id"},
{name:"username",mapping:"name"},
{name:"password",mapping:"password"}
]);
//存储器
var vstore = new Ext.data.JsonStore({
autoDestory:true,
url:'json.action',
reader:new Ext.data.JsonReader({
root:"allUser",
id:"id",
totalProperty:"recordSize"
},user)
});
vstore.load();
var grid = new Ext.grid.GridPanel({
title:"administrator",
store:vstore,
columns:[
{header:"ID", dataIndex:"id",width:20},
{header:"username", dataIndex:"name",width:100},
{header:"password", dataIndex:"password",width:100}
]
});
new Ext.Viewport({
layout:"border",
items:[{
title:"AdminArea",
region:"north",
height:100
},{
region:"west",
title:"Function",
width:150,
split:true
},{
region:"center",
title:"MainArea",
id:"mainContent",
items:grid
}]
});
});
解决方案 »
- MySQL
- strutsTest /WEB-INF/web.xml was not found.
- 查询问题?
- 同花顺 1分钟K线图 文件格式
- 学习java的一个问题
- 一部分人负责开发视图,一部分人负责开发业务,这种模式好吗?项目该如何控制?请大家参与讨论
- 用WSAD单独打包部署EJB项目,如何做?
- ■■vs.net/C#,本世纪最大的谎言.
- 请教一个javamail的问题。。。。麻烦高手指教。。。。在线等待。。。。。
- 看书看糊涂了,下面几个越弄不明白了,哪位指点一下
- 使用hibernate annotation在继承过程中出现Unable to instantiate default tuplizer,找了一天都没找到问题
- ejb和hadoop区别
readRecords ext-all-debug.js (第 11532 行)
f = Record.prototype.fields, fi = f.items, fl = f.length;
断点点进去显示的位置如下:
var s = this.meta, Record = this.recordType,
f = Record.prototype.fields, fi = f.items, fl = f.length;