Ext.Ajax.request怎么传递对象到后台Action

var cell=grid.getSelectionModel().each(function(rec){
// var jsonBean={dept:{id:rec.get('dept.id'),CDept:rec.get('dept.cDept'),CDeptname:rec.get('dept.cDeptname')}};
//var newJson=Ext.encode(Ext.decode(jsonBean));

                       Ext.Ajax.request({
                       url: 'addTJdept.action',
                       method: 'POST',
                        scope: this,
                        params:{
                           id:rec.get('dept.id')
                        },
                        success: function(response, opts){

。。。。。。。。。。。。。
我用的是Struts2+Spring+Hibernate+Extjs
是用Extjs的EditorGridPanel进行修改,不能弹出修改窗体,就直接在表格里修改,然后点击保存提交
上面我注释掉的代码是测试用的 可以获得我选择行的任何值
不过下面的params传参 只能传个字段,不能传一个对象么?
如果用form表单的话,Struts2会自动帮我填充到对象中,
Ext.ajax.request不行么?
我的action返回的是JSON对象的,这里主要就是传个dept这个对象该怎么传到后台Action中

9个回答

不清楚的你的实体是什么,但是使用json对象可以的

。比如你action里有

private User user;

User里有name和age

那么你就可以构造你的json

var jsonBean={'user.name':'张三','user.age':18};

然后params:jsonBean就可以了!

只要是json的格式的 就行

params的参数可以把你要传的值写成一个json对象传递的。你定义一个json对象就好了。封装你的参数

引自官方api
[code="java"]Ext.Ajax.request({
url: 'foo.php',
success: someFn,
failure: otherFn,
headers: {
'my-header': 'foo'
},
params: { foo: 'bar' }//参数名foo 参数值bar
});

[/code]

其中的params可以
var jsonBean={dept:{id:rec.get('dept.id'),CDept:rec.get('dept.cDept'),CDeptname:rec.get('dept.cDeptname')}};

params: jsonBean 这样即可

既然是 struts2 他会默认帮你组转这个对象的!

你可以在 action里面定义一个 dept 类型的对象!

然后在传参数的时候

url: 'addTJdept.action?dept.deptid=123&dept.cDept'=456',

这样传到action 然后就可以调用 dept 这个属性了! 封装好了的! 试试看!

var json= [];
json.push({
id:rec.get('dept.id'),
CDept:rec.get('dept.cDept'),
CDeptname:rec.get('dept.cDeptname'}
})

params: { dept: Ext.encode(json) }

然后后台解析!
这样应该行的

[code="java"]
var json= [];
json.push({
id:rec.get('dept.id'),
CDept:rec.get('dept.cDept'),
CDeptname:rec.get('dept.cDeptname'}
})

params: { dept: Ext.encode(json) }
[/code]

后台
private String dept; 然后set get

JSONArray jsonArray = JSONArray.fromObject(dept);
JSONObject jsonObject = jsonArray.getJSONObject(0);
jsonObject这就是你向后台传的东西 然后做的操作

url: 'addTJdept.action?dept.deptid=123&dept.cDept'=456',

这样传到action 自动变成对象了! 赋值好了的!
然后就可以调用 dept 这个属性了!

你直接
data:{
objectName:{
"propertityName1":"value",
"propertityName2":"value",

}
}

dimmyboy
dimmyboy 不好意思,刚测试了一下,传属性值,在action中implements ModelDriven<Object>...就行了。有问题的话可以联系我664968608@qq.com
6 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Ext.Ajax.request 调用action
我想从页面使用ext调用后台 action, 返回页面一些信息.rn怎么老是action调用完后 页面重定向出错,老是 返回到failure:里面啊?rnrn请高手指教一下 是哪的问题啊?rn简单代码如下:rn前台:rnExt.Ajax.request(url: "BaseInf/Login.action",rn params : , rn success: function(re), rn failure: function( re, o ) rn ) ;rnstruts.xml:rnrn rn rn main/manager_index.jsprn index.jsprn rn rnrnaction:rnpublic class UserAction extends ActionSupportrn public String Login() rn return SUCCESS;rn rn
Ext.Ajax.request获取后台的数据
尝试用Ext.Ajax异步操作来改变页面回显的值,试了好几次都没成功,终于啊,试出来试出来了,功夫不负有心人。(开心) 具体如下:     js代码: Ext.onReady(function(){ var djzcqh = Ext.getCmp('djzcqh').getValue(); Ext.Ajax.request({ url: '/lr/areaActi
struts2的action传递对象的问题
系统使用的是struts2+hibernaternrn jsp界面无法得到从action传来的对象,但是在action 中可以正确显示对象信息,对象实例化不为空.rnrnrn以下是部分日志文件:rnrn2008-05-30 02:46:14,537 DEBUG rnrn(org.apache.struts2.interceptor.FileUploadInterceptor:204) - Bypassing rnrn/admin/book/ Editrn2008-05-30 02:46:14,547 DEBUG rnrn(org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor:134) rnrn- Validating /admin/book/Edit with method load.rn2008-05-30 02:46:14,597 DEBUG rnrn(org.hibernate.event.def.DefaultLoadEventListener:171) - loading entity: rnrn[com.han.domain.model.Book#7584/jkl]rn2008-05-30 02:46:14,607 DEBUG rnrn(org.hibernate.event.def.DefaultLoadEventListener:332) - attempting to resolve: rnrn[com.han.domain.model.Book#7584/jkl]rn2008-05-30 02:46:14,607 DEBUG rnrn(org.hibernate.event.def.DefaultLoadEventListener:349) - resolved object in rnrnsession cache: [com.han.domain.model.Book#7584/jkl]rn2008-05-30 02:46:14,617 DEBUG (org.hibernate.jdbc.JDBCContext:237) - after rnrnautocommitrn2008-05-30 02:46:14,617 DEBUG (org.hibernate.jdbc.ConnectionManager:404) - rnrnaggressively releasing JDBC connectionrn2008-05-30 02:46:14,617 DEBUG (org.hibernate.impl.SessionImpl:422) - after rnrntransaction completionrn//这是从action 中输出的信息rn[color=#FF0000]rnget a book :book 7584/jkl 计算机原理 韩 0.0 计算机数学rn[/color]rn2008-05-30 02:46:14,627 DEBUG (com.han.action.BookAction:58) - get a book rnrn:7584/jklrn2008-05-30 02:46:14,637 DEBUG rnrn(org.apache.struts2.dispatcher.ServletRedirectResult:150) - Redirecting to rnrnfinalLocation /bookshop/admin/book/TestValues.jsprn2008-05-30 02:46:14,637 DEBUG rnrn(org.apache.struts2.dispatcher.ActionContextCleanUp:122) - skipping cleanup rnrncounter=1rn2008-05-30 02:46:14,637 DEBUG (com.han.util.HibernateUtil:31) - 开始数据事务...rn2008-05-30 02:46:14,637 DEBUG (com.han.util.HibernateUtil:63) - begin rnrnTransaction tx......rn2008-05-30 02:46:14,647 DEBUG (org.hibernate.transaction.JDBCTransaction:54) - rnrnbeginrn2008-05-30 02:46:14,647 DEBUG (org.hibernate.jdbc.ConnectionManager:421) - rnrnopening JDBC connectionrn2008-05-30 02:46:14,647 DEBUG rnrn(org.hibernate.connection.DriverManagerConnectionProvider:93) - total checked-rnrnout connections: 0rn2008-05-30 02:46:14,647 DEBUG rnrn(org.hibernate.connection.DriverManagerConnectionProvider:99) - using pooled rnrnJDBC connection, pool size: 0rn2008-05-30 02:46:14,647 DEBUG (org.hibernate.transaction.JDBCTransaction:59) - rnrncurrent autocommit status: falsern2008-05-30 02:46:14,647 DEBUG (org.hibernate.jdbc.JDBCContext:214) - after rnrntransaction beginrnorg.apache.jasper.JasperException: An exception occurred processing JSP page rnrn/admin/book/TestValues.jsp at line 15rn[code=Java]rnrn12: rn13: <%rn14: ValueStack vs = (ValueStack)request.getAttribute("struts.valueStack");rn15: Book booktemp = (Book)vs.findValue("book");rn16: out.print(booktemp);rn17: %>rn18: rnrn[/code]rnrn[color=#FF0000]rnStacktrace:rn at org.apache.jasper.servlet.JspServletWrapper.handleJspExceptionrnrn(JspServletWrapper.java:505)rn at org.apache.jasper.servlet.JspServletWrapper.servicernrn(JspServletWrapper.java:416)rn at org.apache.jasper.servlet.JspServlet.serviceJspFilernrn(JspServlet.java:337)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterrnrn(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilterrnrn(ApplicationFilterChain.java:206)rn at com.han.util.HibernateFilter.doFilter(HibernateFilter.java:36)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterrnrn(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilterrnrn(ApplicationFilterChain.java:206)rn at org.apache.struts2.dispatcher.FilterDispatcher.doFilterrnrn(FilterDispatcher.java:413)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterrnrn(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilterrnrn(ApplicationFilterChain.java:206)rn at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilterrnrn(ActionContextCleanUp.java:99)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilterrnrn(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilterrnrn(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invokernrn(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invokernrn(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invokernrn(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invokernrn(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invokernrn(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.servicernrn(CoyoteAdapter.java:286)rn at org.apache.coyote.http11.Http11Processor.processrnrn(Http11Processor.java:844)rn at rnrnorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processrnrn(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.runrnrn(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rnCaused by: java.lang.NullPointerExceptionrn at org.apache.jsp.admin.book.TestValues_jsp._jspServicernrn(TestValues_jsp.java:69)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.jasper.servlet.JspServletWrapper.servicernrn(JspServletWrapper.java:374)rn ... 24 morern[/color]rn2008-05-30 02:46:17,241 DEBUG (com.han.util.HibernateUtil:41) - 回滚事务rn2008-05-30 02:46:17,241 DEBUG (com.han.util.HibernateUtil:93) - rollback rnrntransactionrn2008-05-30 02:46:17,241 DEBUG (org.hibernate.transaction.JDBCTransaction:152) - rnrnrollbackrn2008-05-30 02:46:17,552 DEBUG (org.hibernate.transaction.JDBCTransaction:163) - rnrnrolled back JDBC Connectionrn2008-05-30 02:46:17,552 DEBUG (org.hibernate.jdbc.JDBCContext:219) - after rnrntransaction completionrn2008-05-30 02:46:17,552 DEBUG (org.hibernate.jdbc.ConnectionManager:404) - rnrnaggressively releasing JDBC connectionrn2008-05-30 02:46:17,552 DEBUG (org.hibernate.jdbc.ConnectionManager:441) - rnrnreleasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open rnrnResultSets: 0, globally: 0)]rn2008-05-30 02:46:17,552 DEBUG rnrn(org.hibernate.connection.DriverManagerConnectionProvider:129) - returning rnrnconnection to pool, pool size: 1rn2008-05-30 02:46:17,552 DEBUG (org.hibernate.impl.SessionImpl:422) - after rnrntransaction completionrn2008-05-30 02:46:17,552 DEBUG (com.han.util.HibernateUtil:51) - close sessionrn2008-05-30 02:46:17,552 DEBUG (org.hibernate.impl.SessionImpl:273) - closing rnrnsessionrn2008-05-30 02:46:17,552 DEBUG (org.hibernate.jdbc.ConnectionManager:375) - rnrnconnection already null in cleanup : no actionrn2008-5-30 2:46:17 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet jsp threw exceptionrnjava.lang.NullPointerExceptionrn at org.apache.jsp.admin.book.TestValues_jsp._jspServicernrn(TestValues_jsp.java:69)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn at org.apache.jasper.servlet.JspServletWrapper.servicernrnrn
jquery ajax传递对象到后台
不用其它的ajax,rn就用jquery ajaxrnvar mydt="ddd":"sssss";rn$.ajax(rnurl:"",rndata:dt:mydtrnrn)rnrn这里怎么将mydt传递到后台rnmydt是一个对象。
【Ionic】——Ionic传递对象到后台
1定义传递的对象的变量 integralProgram :{ pluginId:string ;//插件id userId:string; //被加分人id,以及完成项目的用户id idInfo:string[]; //被加分人id数组 integral:number;//积分 typeKey: string //类型key reason:stri...
javascript 向后台传递对象
如题rnrn在jsp页面中 有个对象 arnrn页面提交 rnrn在后台获取a这个对象rnrnrn请教各位高手
Ext.Ajax.request
由于没使用过extjs,现在刚接触,写了个实现删除功能的ajax交互,代码如下:rn[code=JScript]rn Ext.Ajax.request(rn url : '/C98NetNest/switchsAction.do?method=delete',rn params : rn ip : p_ip,rn mac : macrn ,rn waitTitle : '请稍候',rn waitMsg : '系统正在执行该条命令,请稍候...',rn success : function(response) rn store_switchs.reload();rn Ext.MessageBox.alert("提示",rn "删除交换机成功...");rn ,rn failure : function() rn Ext.MessageBox.alert("提示",rn "您出错啦...");rn rn );rn[/code]rn我调试的时候,他不执行这段,那位高手给解释下,可能是什么原因,谢谢!
ext.ajax.request
为什么我写的EXT 代码请求都发不出去  地址栏里输入请求又可以正常访问  EXT里面就不行  运行就弹出LOST对话框n n 问题补充: 的确是URL 写错了   谢谢你的帮助
vue-axios-post方式传递对象至后台
1.对象参数类型JSON化: data:JSON.parse(JSON.stringify(object)), 2.头部信息headers: &amp;amp;quot;Content-Type&amp;amp;quot;: &amp;amp;quot;application/json; charset=UTF-8&amp;amp;quot; 3.service中请求方式写为POST 4.后台controller中获得参数方式:@RequestBody Strin...
Ext.Ajax.request正请求后台数据时…
2014第一篇! Ext.form.FormPanel 中的 form.submit 有一个   waitMsg:'自定义信息'  属性可以做到这个效果. 那么Ext.Ajax.request可以通过设置什么属性来做到这个效果呢?  waitMsg不行。 相对简洁有效的方法如下: 在Ext.Ajax.request的前一行执行Ext.MessageBox.wait('正在操作','请稍后...'
asp.net 后台如何解码ext.ajax.request的字符串
Ext.lib.Ajax.request(rn 'POST',rn 'UserManage.aspx',rn success: function(response)rn Ext.Msg.alert('信息', response.responseText, function()rn store.reload();rn );rn ,failure: function()rn Ext.Msg.alert("错误", "与后台联系的时候出现了问题");rn ,rn 'data=' + encodeURIComponent(Ext.encode(jsonArray))rn );rn前台传过来datarnasp.net后台怎么解码
关于Ext.Ajax.request访问后台方法 的问题
Ext中rn[code=JScript]rn Ext.Ajax.request( rn url : '/login.do?method=LoginServlet&userName='rn + name + '&userPwd=' + pwd,rn success : function(data) rn alert(data);rn rn );rn[/code]rnAction中rn[code=Java]rnrn public void LoginServlet(HttpServletRequest request,rn HttpServletResponse response) throws Exception rnrn System.out.println("进来--BaseController类中了");rn String name = request.getParameter("userName");rn String pwd = request.getParameter("userPwd");rnrn if (pwd.equals("")) rn response.getWriter().write("success:false,msg:'请输入密码!'");rn return;rn rn DataQueryManager opermanager = (DataQueryManager) thisrn .getBean("opManager");rn response.getWriter().write(opermanager.GetUser(name, pwd));rnrn rn[/code]rnservice中rn[code=Java]rnpublic String GetUser(String name, String pwd) rn System.out.println("进来管理页面了");rn String sql = "select [name],[pwd] from [user] where [name]='" + namern + "'";rn try rnrn Object[] object = (Object[]) dataQueryDAO.GetObjectById(sql);rn if (object == null) rn return "success:false,msg:'没有该用户!'";rn rn String userpwd = object[1].toString();rn String msg = "success:false,msg:'密码错误!请重新输入密码!'";rn if (pwd.equals(userpwd)) rn msg = "success:true,msg:'登录成功!'";rn rn return msg;rn catch (Exception e) rn return "success:false,msg:'数据库操作错误!'";rn rn rn[/code]rnspring配置rn[code=XML]rnrn rn rn logrn rn rn rn rn[/code]rnrn问题是 配置的路径是对的 但是url没有连接到后台方法 找了很久都不知道怎么回事 请帮我看看 几个星期前这个问题就没搞定 当初发帖问了 没人回答 这次想把他搞定 在问问看
Ext.Ajax.request() 请求
请问一下:rnrn 对Ext.Ajax 与服务器的交互一直都不太能理解,并且对Ext.Ajax.request()rn rn 在什么时候才用,是每个请求都需要吗,但是有时只是跳转到另外一个页面,比如,rnrn 我要修改一行数据,点击修改连接,这样子就跳到修改页面,那是需要通过ajax请求吗?rnrn 它的请求也是必须要有返回函数吗? 如果提交一个请求到action,什么情况才考虑到rnrn 需要用resposne返回数据到前台页面? 对这方面都一直有点困扰了?rnrnrn 对了,还有个问题,如果将后台数据加载到表单页面里面?只是直接将得到的数据存为json格式就可以了吗?rnrnrnrnrnrnrn
struts 如何从页面传递对象到action
请问如何用checkbox 打钩的时候传递对应的一条对象到action中?rnrnrn rn rnrn我现在需要在checkbox选中时把遍历的对象传递到我的action中的test属性中。请问如何做到啊,或者有什么替代的方案。 谢谢
Jsp页面怎么传递对象到Servlet
Jsp初学者,想把Jsp页面里本来已经存在的对象(sessionScope得来的),传参到另外一个Servlet里处理。rnJsp页面存在的对象:rn[code=text] $sessionScope.Cart [/code]rn[code=text]$sessionScope.user[/code]rn传参代码如下:rn[code=text] 去下单 [/code]rnrn结果发现一直传参失败,提示空指针,但是在浏览器地址栏发现提交上去的参数是:rnrn[code=text]http://localhost:8080/TakewayWeb/getOrders?user=com.Takeway.model.User@335c9979&Cart=3=com.Takeway.model.Cart@b581ee4,rn[/code]rn提交上去的是地址,然而是空指针错误,取值失败。rnrnServlet里取对象代码:rnrn [code=text] User user =(User) request.getAttribute("user");rn Map cart = (Map) request.getAttribute("Cart");[/code]
Struts2的自定义标签怎么传递对象
先看页面代码rn[code=Java]rnrnrn[/code]rnpage.pageNow可以正确显示,但是我加上后面那个自定义标签就会报错,我试过传普通String类型的数据可以接受的到,rn对象不行。rn----------------------------------------------------------------------------------------------------------rn我想把值栈中的page对象交给PageLink(标签处理类)去处理rn[code=Java]rn/**rn * Title:标签处理类rn * @author Administratorrn *rn */rnpublic class PageLink extends ComponentTagSupport rnrn private static final long serialVersionUID = 1477382188664610844L;rn rn private Page page;rn rn public Page getPage() rn return page;rn rnrn public void setPage(Page page) rn this.page = page;rn rn rn @Overridern protected void populateParams() rn super.populateParams();rn PageLinkComponent plc = (PageLinkComponent)component;rn plc.setPage(page);rn rnrn @Overridern public Component getBean(ValueStack stack, HttpServletRequest request,rn HttpServletResponse response) rn return new PageLinkComponent(stack);rn rn rn rnrn[/code]rn----------------------------------------------------------------------------------------------------------rnrn报错信息rn[code=Java]rnStacktracesrnorg.apache.jasper.JasperException: Unable to convert string "%page" to class "com.free.component2.Page" for attribute "page": Property Editor not registered with the PropertyEditorManager rn org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager(JspRuntimeLibrary.java:884)rn org.apache.jsp.pages.log.index_jsp._jspx_meth_p_005fpageLink_005f0(index_jsp.java:450)rn org.apache.jsp.pages.log.index_jsp._jspService(index_jsp.java:168)rn org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)rn org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)rn org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461)rn org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:399)rn org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)rn org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)rn org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)rn com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:362)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:266)rn com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252)rn org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237)rn org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488)rn org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)rn org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)rn org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)rn org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)rn org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)rn org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)rn org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)rn org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)rn org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)rn org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)rn org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)rn org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)rn org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)rn java.lang.Thread.run(Thread.java:619)rnrn[/code]rn----------------------------------------------------------------------------------------------------------rnrnTLD文件应该也是配置正确的rn[code=Java]rnrnrn 分页自定义标签rn 1.0rn pagern /page-tagsrn rn pageLinkrn com.free.component2.PageLinkrn JSPrn 分页跳转rn rn pagern truern com.free.component2.Pagern rn rnrn[/code]rn----------------------------------------------------------------------------------------------------------rnrn像我这要把值栈中的某个对象传进去应该怎么做?
struts2 JSP向 ACTION传递对象问题
在第一个ACTION把BEAN 传递到了JSP 。想在这个JSP把这个BEAN直接传递到下一个ACTION。不知道怎么传递。rnFORM如下: rn rnrnrnrnHIDDEN放的都属BEAN的属性。请问下能把BEAN整体都传过去么 一个一个属性传递太麻烦了
关于EXT.AJAX.REQUEST
我的后台是SERVLET为什么我的后台得不到数据呢;请高手帮我指点一下rn============================= js =======================================rn Ext.Ajax.request(rn url:'http://localhost:8080/MYEXT/a.pro',rn params:param:"param",rn success:function(result)rn Ext.Msg.alert("提示",result.responseText); rn rn );rn=========================== Servlet======================================rnpackage classBox;rnrnimport java.io.IOException;rnimport java.io.PrintWriter;rnrnimport javax.servlet.ServletException;rnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnrnpublic class Treatment extends HttpServlet rn public void doGet(HttpServletRequest request, HttpServletResponse response)rn throws ServletException, IOException rnrn response.setContentType("text/html");rn response.setCharacterEncoding("UTF-8");rn request.setCharacterEncoding("UTF-8");rn PrintWriter out = response.getWriter();rn tryrn if(request.getParameter("param")!="" && request.getParameter("param")!=null)rn DataBase.ExecInsert(ConnectionClass.AccessConnInfo(),"insert into Test(type,[money])values('收入',85000)");rn catch(Exception ex)rn out.println(ex.getMessage());rn rn out.flush();rn out.close();rn rn private static final long serialVersionUID=1L;rnrn
Ext.Ajax.request跨域
NULL 博文链接:https://chun521521.iteye.com/blog/1935516
关于Ext.Ajax.request()
Ext.Ajax.request(rn url : 'WebQQ2009/addFrient.do',rn params : rn currentUser : currentUserrn,rn success : function(response) rn alert("success:"+response.responseText);rn Ext.MessageBox.alert("成功","添加好友成功");rn Ext.getCmp("clientWindow").updateUserList();rn ,rn failure : function(response) rn alert("failure:"+response.responseText);rn Ext.Msg.show(rn itle : '错误提示',rn msg : '添加失败!',rn icon : Ext.Msg.ERROR,rn buttons : Ext.Msg.OKrn rn )rn rn rn )rnrn上面的程序弹出对话框显示的值是:success:'success':'false','message':'Failure'rnrn我就郁闷了。为什么返回的是'success':'false','message':'Failure',怎么是触发success函数,不是应该触发failure函数吗???谁能帮我解释下吗????rnrn用response.getWriter().write()rn怎样才能让它触发failure函数n[b]问题补充:[/b]n在此先谢谢Snow_Young!rnrn我想再问用response.getWriter().write() 是不是就只能传递一个值,如果我想让它返回几个参数能实现吗???rnrn或者帮我解释下response.getWriter().write("'sucess':'false,'message':'Failure'");中的"'sucess':'false','message':'Failure'"是什么意思,在JS里该怎样运用,或者说用response.responseText怎样去分析'sucess'是false还是true???????????????
传递对象
rnrn rnrn但是,我点了button后,没有反应。。rnrn
这个input怎么执行后台的action
[code=html] rn rn rn rn 文件上传rn rn rn rn rn rn 选择文件rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn[/code]rnrnrn我想点击上传的时候能上传 点击完成的时候能提交表单数据。现在我点击完成执行的是Project_dataInput.action,但是上传的时候我想再在Project里加个upload方法,让点击完成的时候执行upload这个方法 该怎么做?我现在用input name="aa" type="submit" class="button02" value="上传" id="ss" onclick="upload();"/>文件上传不了 点击完成也提交不了表单 是怎么回事?
请问android 怎么调用后台 java action?
我想调用java action,请问怎么调啊。
jquery怎么将值传到后台Action
已知界面n![图片说明](https://img-ask.csdn.net/upload/201509/01/1441092958_627727.png)n## 当选中所有复选框的时候,将每行的编号存入到一个List集合中,请问怎么实现。nn以下为页面代码:n![图片说明](https://img-ask.csdn.net/upload/201509/01/1441093169_847899.png)n![图片说明](https://img-ask.csdn.net/upload/201509/01/1441093157_66905.png)n![图片说明](https://img-ask.csdn.net/upload/201509/01/1441093182_809905.png)
struts2 怎么在action后台取得多选框的值?
HttpServletRequest request=ServletActionContext.getRequest();rnlong[] del=Integer.parseInt(request.getParameter("box"));rnrn这样为什么不行啊
Vue传递对象数据,后台解析并使用
1.首先是vue对应的实体操作代码 &lt;el-dialog title="标签修改" :visible.sync="FormVisible"&gt; &lt;el-radio-group v-model="labelPosition" size="small"&gt; &lt;el-radio-button label="left"&gt;左对齐&lt...
后台Action json解析
前台传参 private String alarmName;rn private String firstFormula;rn private String secondFormula;rn private String thirdFormula;rn private String invokerTime;rn前台是Ext,所以要解析,实现Action的一个保存对象,就是把前台的数据 放到json数组解析成java数组,对象操作保存rn小弟才疏学浅,希望高手指导,感激不尽!!!rn在线等!!!rn在线等!!!!
ajax 传递对象 后台接受映射 不成功
1. 检查对象、属性名字是否正确 2. 实体类对象没有设置set方法
ajax/javascript先后台传递对象参数
在做spring MVC开发的时候,我需要在页面的JavaScript中将js对象拼接成后台spring Controller需要接收的Javabean对象。示例如下: /** * 更新团队资源 * * @param response * @param teamResource */ @RequestMapping...
Ext.Ajax.request 小问题收集
Ext.Ajax.request同步请求包 博文链接:https://lingf.iteye.com/blog/1195912
Ext.Ajax.request同步请求实现
Ext.Ajax.request在2.x是异步请求的,这样话在当前请求没有完成之前就不能在它的外部使用它的返回值,在下面这个表单验证中如果不是同步请求的话就有问题了,如: var text = new Ext.form.TextField({ fieldLabel : '名称', height : 23, width : 400, id : 'flowName', name : 'flowNam...
Ext.Ajax.Request在websphere下报错
function ajaxsumbit(url,params)rn //创建Ajax.Request对象,对应于发送请求 rn var myAjax = new Ajax.Request(rn url,rn rn //请求方式:POSTrn method:'post',rn //请求参数rn //parameters:params,rn parameters:params,rn //指定回调函数rn onComplete: callback,rn //是否异步发送请求rn asynchronous:falsern );rn return returnResponseText;rnrnrnrn上面这段js在weblogic和tomcat下运行是好的,但在websphere下运行报错rnrn有哪位兄弟遇到过这样的问题吗?rnrn报错信息:servlet action 的某一服务方法创建了未捕获到的异常。创建的异常:java.lang.NullPointerException
Ext.Ajax.request中的jsonData问题
利用Ext.Ajax.request(rn jsonData:objrn);rn发送一个请求,在java中怎么得出来?用流接收不到啊!
request在jsp之间怎么传递对象?
<% rnFormBean fb = new FormBean(); rnrequest.setAttribute("aa",fb); rn%> rnrn rn rn rn rn rn rn rnrntest2.jsp 如下 rnrn<% rnObject obj = request.getAttribute("aa"); rnout.println(obj.toString()); rn%> rnrn上例子中我想在test.jsp中把FormBean 传递到test2.jsp 中, 可是我用request.getAttribute("aa") 得到的是Null rnrn请问我如何做才能实现在jsp间传递java 对象? 请给代码参考,谢谢. rn
request在jsp页面间怎么传递对象?
request在jsp页面间怎么传递对象?
jsp怎么向servlet传递对象!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
我在jsp页面是这样用的rnrnrequest.setAttribute("rights",rights);rn rnrn可是在servlet里面却没有收到rights!
jsp怎么向servlet传递对象?
如题.
JSP表单怎么传递对象到servlet
[code=html]rn rn rn $stu.getNumber()rn $stu.getName()rn $stu.getCollege()rn $stu.getMajor()rn $stu.get_Class()rn rn rn rn rn rn rn rnrn[/code]rnrn表格的显示效果是每一行都带有”修改“和”删除“两个按钮。rnrnrnrn如代码所示,我想点击“删除”的时候删除数据库中这一行的数据,servlet删除的操作已经搞定,现在遇到的问题是不知道怎么点击”删除“的时候把当前这个 stu 这个对象传到servlet去? 求指点…
C#传递对象,请问要怎么用c#流传递对象呢?
两边都有networkstream 了,也都有一个类,要怎么传递呢?rnrnremote要怎么用呢?这用remote是不是杀鸡用牛刀啊
ajax提交后台action后,怎么让后台action中跳转页面
由于之前用jquery的submit事件提交表单时,ckeditor中的内容提交不了rnrnrn```rn $("#sendmail").submit();rn```rnrn所以我换了ajax提交,a但是现在ajax提交有一个问题.我需要的是表单提交到action中,rnaction中进过struts,跳转到对应的成功界面,但是由于ajax,我action中 的功能实现了,就rn是不能进行跳转,界面一直显示发送中,想请问一下各位这是怎么回事.rn我期望发生的是ajax只把data传给action后success中不用处理任何东西,由atruts跳转到新jsprnjsp代码rnrnrn```rn $.ajax(rn type: "POST",rn url: "<%=basePath%>user/sendMail!checkName.action",rn data: parm,rn dataType:"text",rn success: function (data, textStatus) rn hiddenProgress();//隐藏进度条rn if(data=='true')rn showProgress("正在发送邮件...");//显示保存进度rn //$("#sendmail").submit();rn $.ajax(rn type: "POST",rn url: "<%=basePath%>user/sendMail!sendEmail.action",rn data: parm,rn dataType:"text",rn success:function(data)rn // alert("发送成功");rn // window.location.href="<%=basePath%>user/user_sendMail_success.jsp";rn ,rn );rnrn rn ........................rnrn rn```rnaction中的部分代码rnrnrn```rn mailInfoFB.setSended(true);rn mailInfoFB.setFrom("邮件发送成功!");rn return "sendMailSuccess";rn```rnrnrn
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法