新手出道! 学习了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
}]
});
});
解决方案 »
- spring管理jms,connectionFactory为null
- JSP中的<c:foreach>标签问题 急!
- 请问一下hibernate对于数据源及事物的管理是借助的threadlocal吗?
- 各位高手快帮帮我吧,死活没显示
- java web开发才上手,请问Servlet+tomcat的系统可以做单步跟踪调试吗?
- 引用MouseListener要用abstract来修饰吗????
- 编写BMP时遇到的困难,请赐教
- JAVA中如何引用放在其他包里的类
- Help!关于J2EE规范.
- java socket发送byte数组能成功 netty框架不行
- 使用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;