我正在使用带有Bean验证的JAX-RS资源,并且按预期在这两个作品之间进行了集成。
但是,在验证错误报告参数名称为arg0的情况下会生成默认错误消息,如下所示
[PARAMETER]
[login.arg0.password]
[password is required]
[]
Run Code Online (Sandbox Code Playgroud)
对应的方法定义:
@POST //and other JAX-RS annotations
public Response login(
@NotNull
@Valid
LoginBody loginBody) {
[...]
protected static class LoginBody {
@NotNull(message = EMAIL_REQUIRED)
public String email;
@NotNull(message = PASSWORD_REQUIRED)
public String password;
}
Run Code Online (Sandbox Code Playgroud)
尽管我对这种消息模式总体上很满意,但实际上令人anny恼的是,原始参数名称未被识别,即,我希望看到
登录。loginBody .password而不是arg0。
是否有解决此问题的简便方法,例如以某种方式为该参数提供一个明确的名称?
我正在使用WildFly Swarm 2017.6.0。从我发现的结果来看,这意味着我拥有resteasy + resteasy-validator +休眠验证器
谢谢。
我是Javascript和AngularJS的新手,这个让我挠头:/
前提
是)我有的
这是有问题的方法:
service.getSlices = function() {
Restangular.all('entries').getList().then(function(entries) {
//some rather complex modification of the backend data go here
//...
return resultOfModification; //this is what should be returned for getSlices();
})
//I want the resultOfModification to be returned here
};
Run Code Online (Sandbox Code Playgroud)
这个问题
基本上我想等到getSlices()承诺得到解决resultOfModification才能在实际计算时返回我的承诺.
另外的情况
我也可以想象返回一个承诺getSlices(),然后提供resultOfModification.但是我担心我不太了解这个和/或同时太沮丧/厌倦.
答案和任何建议都是受欢迎的,特别是指向良好的阅读材料.谢谢
我有一个支持悬停的表格class="table-hover".但是,我想在悬停时不要突出显示某些行(具有不同颜色).
我已经从bootstrap复制了悬停规则并将其调整为tr.no-hover:
.table-hover tbody tr.no-hover:hover > td,
.table-hover tbody tr.no-hover:hover > th {
background-color: inherit;
}
Run Code Online (Sandbox Code Playgroud)
我的想法是,这样它应该显示行的原始(即未覆盖)颜色,因为我希望no-hover通用应用于不同颜色的行.但那没用.也没有指定transparent为颜色.
基本上,我需要的是删除某些行上的悬停效果.有没有办法做到这一点?