我正在服务器端进行身份验证和授权.
在angularJs中,我正在使用routeProvider进行路由.
$routeProvider.
when('/', {
templateUrl: 'partials/_home',
controller: 'HomeCtrl'
}).
when('/home', {
templateUrl: 'partials/_home',
controller: 'HomeCtrl'
}).
when('/users', {
templateUrl: 'partials/_users',
controller: 'UserCtrl'
}).
when('/users/:id', {
templateUrl: 'partials/_userForm',
controller: 'UserCtrl'
}).
otherwise({
redirectTo: '/'
});
Run Code Online (Sandbox Code Playgroud)
这里是要解决的问题,当我得到403角度没有显示服务器页面时,它只是没有做任何事情.

有人建议如何处理这个问题吗?
问题是:我可以成功注册过滤器,但不知道如何使用此特定配置设置映射URL.
这是我的班级:
public class WebInitializer extends
AbstractAnnotationConfigDispatcherServletInitializer {
@Override
protected Class<?>[] getRootConfigClasses() {
return new Class<?>[]{AppConfig.class};
}
@Override
protected Class<?>[] getServletConfigClasses() {
return new Class<?>[]{WebConfig.class};
}
@Override
protected Filter[] getServletFilters() {
return new Filter[]{
new DelegatingFilterProxy("springSecurityFilterChain"),
new DelegatingFilterProxy("customFilter")
};
}
@Override
protected String[] getServletMappings() {
return new String[]{"/"};
}
}
Run Code Online (Sandbox Code Playgroud)
PD我用它做过WebApplicationInitializer,但我想用AbstractAnnotationConfigDispatcherServletInitializer.
当对控制器执行异步请求(不使用注释)时,我得到此错误,有人知道为什么吗?
我使用的是spring 4.0.5和wildfly 8.1.0
16:42:48,621 DEBUG [io.undertow.request.io](默认任务-20)UT005013:发生IOException:java.io.IOException:UT000029:频道在块中间关闭,如果您尝试编写分块数据在完全写入之后才能关闭通道.
一些柴它不工作的原因
promise = doSomething()
expect(promise).to.eventually.equal(obj)
expect(promise).to.eventually.deep.equal(obj)
Run Code Online (Sandbox Code Playgroud)
但在断言错误中我得到了这个
AssertionError: expected {a: "2", b: "3"} to equal {a: "2", b: "3"}
顺便说一句,我已经尝试过should并且得到了相同的结果
这是交易.
我在做一个$ http调用时会显示一个微调器,但问题是我有多个调用,所以我在这里找到的例子没有帮助.
有人有解决方案吗?
一种堆叠调用的方法,以便微调器保持到最后一次调用结束?我希望能说明问题.
我这样做.
angular.module('moduleName', []).
factory.("SomeService", function () {
return:{
getResources(params) {
/* do the $http call */
}
}
}).
controller("SomeCtrl", function (SomeService) {
SomeService.getResources(params)
}).
controller("OtherCtrl", function (SomeService) {
SomeService.getResources(params)
});
Run Code Online (Sandbox Code Playgroud)
2个控制器可以同时调用服务,可能会得到不同的响应.
我正在使用 Chai 进行测试,我想深入比较 promise 中返回的对象。
我试过这种方法:
expect(promise).to.eventually.eql(object)
expect(promise).deep.equals(object)
expect(promise).should.eventually.equal(object)
Run Code Online (Sandbox Code Playgroud)
但它不起作用。我检查了许多其他样本,但没有一个有效。这就是我得到的:
断言错误:未指定的断言错误
有没有人经历过类似的事情?
(顺便说一句,“对象”包含一个对象数组......)