返回没有意见从Ajax请求的动作在Struts 2 [英] Return no view from action in ajax requests struts 2

查看:97
本文介绍了返回没有意见从Ajax请求的动作在Struts 2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个下拉列表区域选择,当用户改变它,然后我送一个Ajax请求我在哪里设置会话边界

I have a drop down list for locale selection, when user changes it then i send an ajax request to an action where i set a session perimeter

现在的问题是,我应该怎么从动作的execute()方法

Now the problem is that what should i return from the execute() method of the action

推荐答案

您可以返回一个HTTP 200 OK,这应该是一个空的,成功的响应。

You can return an HTTP 200 OK, which should be an empty, successful response.

<result name="empty" type="httpheader">
    <param name="status">200</param>
</result>

我会做一个全球性的结果,这样就可以使用它的任何行动。

I would make a global result so that you can use it any action.

这篇关于返回没有意见从Ajax请求的动作在Struts 2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆