本来Controller接到普通请求,return “somePage”,这样就跳转了。
前台用$.post()提交了数据(不需要回调),我了个大草,return那里就不给跳转了
这样怎么解决?

ajax是无法再controller里面return 跳转的,可以返回后再  ajax的success里面进行  window.location.href

Ajax是异步请求 只会接收最后返回的数据,不会执行页面跳转请求改变url地址,要跳转的话,可以使用window.location.href

$.post()是简写的ajax函数
$.ajax({
type: 'POST',
url: url,
data: data,
success: success,
dataType: dataType
});
声明是:
jQuery.post( url [, data ] [, success ] [, dataType ] )
可以在回调函数中处理,或者 .done中处理:
var jqxhr = $.post( "example.php", function() {
alert( "success" );
})
.done(function() {
alert( "second success" );
})
.fail(function() {
alert( "error" );
})
.always(function() {
alert( "finished" );
});

  

Null ModelAndView returned to DispatcherServlet with name 'webmvc': assuming HandlerAdapter completed request handling

随机推荐

  1. [Python] Histograms for analysis Daily return

    A histogram is an accurate representation of the distribution of numerical data. Y axis is the occur ...

  2. aui-dialog改造,支持关闭

    1.打开aui-dialog.js 添加关闭html代码 var headerHtml = params.title ? '<div class="aui-dialog-header ...

  3. Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported

    Uncaught DOMException: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may no ...

  4. powerpoint(ppt) 的制作

    1. 幻灯片母版 所谓母版,是共享的部分,也即想在全部幻灯片重复出现的元素. 首先,幻灯片母版在菜单栏的[视图]选择[幻灯片母版]显示和查看. 通过幻灯片母版的编辑和设计,可进一步: 在幻灯片的相关位 ...

  5. js阻止默认事件与js阻止事件冒泡

    e.stopPropagation(); //阻止事件冒泡 功能:停止事件冒泡 function stopBubble(e) { // 如果提供了事件对象,则这是一个非IE浏览器 if ( e &am ...

  6. [ DB ] [ SQL ] [ SQL Server ] MS SQL 建立暫存表格 temp table - 轉載

    範例 SQL: IF OBJECT_ID(N'tempdb.dbo.#tmp_checkStatusCount', N'U') IS NOT NULL DROP TABLE #tmp_checkSta ...

  7. Centos7部署phpMyAdmin系统

    phpMyAdmin是一个使用PHP语言编写,用来管理MYSQL数据库的Web应用系统 一:安装phpMyadmin 下载phpMyadmin最新版本4.8 wget https://files.ph ...

  8. 紫书 习题 10-25 UVa 1575 (有重复元素的全排列+暴搜)

    我一开始以为有什么很牛逼的方法来做,然后一直没有思路 后来看了https://blog.csdn.net/zju2016/article/details/78562932的博客 竟然是暴搜?????? ...

  9. hdu 5312 Sequence(数学推导——三角形数)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5312 Sequence Time Limit: 2000/2000 MS (Java/Others)  ...

  10. IOS基础学习日志(七)利用dispatch_once创建单例及使用

    自苹果引入了Grand Central Dispatch (GCD)(Mac OS 10.6和iOS4.0)后,创建单例又有了新的方法,那就是使用dispatch_once函数,当然,随着演进的进行. ...