1、action中配置了
Paper paper;及其 get/set2、EXTJS代码:
//ajax提交开始
Ext.lib.Ajax.defaultPostHeader +=";charset=utf-8";
//提交到服务器操作Action方法
addPaperForm.form.doAction('submit',{
url:'<%=basePath%>login/paper_add.action', //Action路径
method:'post', //提交方法post或get
param:'',
//提交成功的回调函数
success:function(form,action){
//alert(form.findField("paper.title").getValue());
//alert(form.findField("paper.abstra").getValue());
Ext.Msg.alert("提交成功!","您的论文已经正确提交!");
_window.hide();
},
//提交失败的回调函数
failure:function(form,action){
if(action.failureType=="connect"){
Ext.Msg.alert('错误','服务器出现错误请稍后再试!');
}
}
});
//ajax提交结束3、form表单:
var addPaperForm = new Ext.FormPanel({
width:500,
height:300,
defaultType:"textfield",
labelWidth:60,
baseCls:"x-plain",
style:"padding:15px",
items:[
{
id:"paper.title",
name:"paper.title",
fieldLabel:"论文标题",
allowBlank:false,
width:400
},
{
id:"paper.abstra",
name:"paper.abstra",
xtype:"textarea",
fieldLabel:"论文摘要",
allowBlank:false,
width:400,
height:150
},
{
id:"paper.other",
name:"paper.other",
xtype:"textarea",
fieldLabel:"参考文献",
width:400,
height:80
}
]
});
问题::
每次提交只能在action接收到paper.title属性!其他两个怎么也接收不到。
但是我在success里执行alert(form.findField("paper.abstra").getValue())却能得到后台没取到的值。
-----
我的struts.xml:
<!-- 后台操作 -->
<package name="login" extends="struts-default" namespace="/login" >
<!-- 论文 -->
<action name="paper_*" class="paperAction" method="{1}">
<result name="getManage">/login/manage.jsp</result>
</action>
...万分感谢!
Paper paper;及其 get/set2、EXTJS代码:
//ajax提交开始
Ext.lib.Ajax.defaultPostHeader +=";charset=utf-8";
//提交到服务器操作Action方法
addPaperForm.form.doAction('submit',{
url:'<%=basePath%>login/paper_add.action', //Action路径
method:'post', //提交方法post或get
param:'',
//提交成功的回调函数
success:function(form,action){
//alert(form.findField("paper.title").getValue());
//alert(form.findField("paper.abstra").getValue());
Ext.Msg.alert("提交成功!","您的论文已经正确提交!");
_window.hide();
},
//提交失败的回调函数
failure:function(form,action){
if(action.failureType=="connect"){
Ext.Msg.alert('错误','服务器出现错误请稍后再试!');
}
}
});
//ajax提交结束3、form表单:
var addPaperForm = new Ext.FormPanel({
width:500,
height:300,
defaultType:"textfield",
labelWidth:60,
baseCls:"x-plain",
style:"padding:15px",
items:[
{
id:"paper.title",
name:"paper.title",
fieldLabel:"论文标题",
allowBlank:false,
width:400
},
{
id:"paper.abstra",
name:"paper.abstra",
xtype:"textarea",
fieldLabel:"论文摘要",
allowBlank:false,
width:400,
height:150
},
{
id:"paper.other",
name:"paper.other",
xtype:"textarea",
fieldLabel:"参考文献",
width:400,
height:80
}
]
});
问题::
每次提交只能在action接收到paper.title属性!其他两个怎么也接收不到。
但是我在success里执行alert(form.findField("paper.abstra").getValue())却能得到后台没取到的值。
-----
我的struts.xml:
<!-- 后台操作 -->
<package name="login" extends="struts-default" namespace="/login" >
<!-- 论文 -->
<action name="paper_*" class="paperAction" method="{1}">
<result name="getManage">/login/manage.jsp</result>
</action>
...万分感谢!
解决方案 »
- 监控weblogic出错
- hibernate映射问题
- 关于乱码的解决,谢谢!
- 用tomcat运行jsp文件出错
- 求(java中)在网页中直接打开word文档的方案?
- java 快速读取文件的方法。
- 急!!!请高手帮忙开发一个简单j2ee应用,50分酬谢!!!
- 使用ibatis时,sql脚本中有中文的表名、字段名称的问题。
- 如何用JavaScript取和设置Struts中<html:text property="tt" value="ddddd">的value值
- 请教:J2EE哪本书写的好一点?最好是翻译版的。新手如行,呵呵
- Hibernate 3.0 查询 Grou by 怪 真是怪
- 急!!tomcat启动报错:Error configuring application listener of class com.mot.rbt.listen
<package name="login" extends="struts-default" namespace="/login" >
<!-- 论文 -->
<action name="paper_*" class="paperAction" method="{1}">
<result type="json" />
</action>
<package name="login" extends="json-default" namespace="/login" >
<!-- 论文 -->
<action name="paper_*" class="paperAction" method="{1}">
<result type="json" />
</action>