我有一个抽象的课.我想通过另一个抽象类扩展抽象类,然后实现扩展的抽象类.是否可能.如果是的话,对于OOPS来说,这是否是一个好的方法?
try {
} catch() {}
finally {
try {
} catch() { }
finally { }
}
Run Code Online (Sandbox Code Playgroud)
拥有上面的代码是好的吗?
鉴于:
<ul id="myList" class="list-group">
<li>Remove Me 1</li>
<li>Remove Me 2</li>
<li>Remove Me 3</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
我想从父级ul中删除所有li子项,以便当我这样做时:
$("#myList").append("<li>New li 1</li>");
Run Code Online (Sandbox Code Playgroud)
我结束了
<ul id="myList" class="list-group">
<li>New li 1</li>
</ul>
Run Code Online (Sandbox Code Playgroud)
代替:
<ul id="myList" class="list-group">
<li>Remove Me 1</li>
<li>Remove Me 2</li>
<li>Remove Me 3</li>
<li>New li 1</li>
</ul>
Run Code Online (Sandbox Code Playgroud) 的Number子类包裹原始数值类型(Byte,Integer,Double,Float,Long,和Short).
他们的目的是什么?
我有以下配置
@Configuration
@EnableMongoRepositories(basePackages = Constants.DATA_SCAN)
@EnableMongoAuditing(auditorAwareRef = "auditorAwareService")
@Import(value = MongoAutoConfiguration.class)
public class DatabaseConfiguration {
@Bean
public ValidatingMongoEventListener validatingMongoEventListener() {
return new ValidatingMongoEventListener(validator());
}
@Bean
public LocalValidatorFactoryBean validator() {
return new LocalValidatorFactoryBean();
}
@Bean
public CustomConversions customConversions() {
final List<Converter<?, ?>> converters = new ArrayList<>();
converters.add(DateToZonedDateTimeConverter.INSTANCE);
converters.add(ZonedDateTimeToDateConverter.INSTANCE);
return new CustomConversions(converters);
}
}
Run Code Online (Sandbox Code Playgroud)
我添加了自定义转换器,但我仍然得到:
在实体类java.time.ZonedDateTime上找不到属性null以将构造函数参数绑定到!
@Document(collection = "user")
public class User implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private String id;
@Field("reset_date")
private ZonedDateTime resetDate = …Run Code Online (Sandbox Code Playgroud) java spring-data spring-data-mongodb jhipster spring-mongodb
我有以下路由配置,但我收到错误 Invalid configuration of route 'tenant': redirectTo and children cannot be used together
一旦我点击/租户,我想以某种方式显示两个租户的内容,然后审计?这可能吗 ?我的租户网址如下所示http://localhost:8080/#/tenant
{
path: 'tenant',
redirectTo: '/tenant/(view:audit)',
pathMatch: 'full',
component: TenantComponent,
data: {
authorities: ['ROLE_USER', 'ROLE_ADMIN'],
pageTitle: 'tenant.home.title'
},
children: [
{
path: 'audit',
component: PacketDataComponent,
data: {
authorities: ['ROLE_USER', 'ROLE_ADMIN'],
pageTitle: 'tenant.home.title'
},
}
]
}
Run Code Online (Sandbox Code Playgroud) 在ParentComponent =>中
ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: ''. Current value: '[object Object]'.
at viewDebugError (vendor.bundle.js:8962)
at expressionChangedAfterItHasBeenCheckedError (vendor.bundle.js:8940)
Run Code Online (Sandbox Code Playgroud)
父组件Html
<div>
<app-child-widget [allItems]="allItems" (notify)="eventCalled($event)"></app-child-widget>
<div>
Run Code Online (Sandbox Code Playgroud)
父组件
export class ParentComponent implements OnInit {
returnedItems: Array<any> = [];
allItems: Array<any> = [];
constructor(
) { }
ngOnInit() {
this.allItems = // load from server...
}
eventCalled(items: Array<any>): void {
this.returnedItems = items;
}
}
Run Code Online (Sandbox Code Playgroud)
儿童组件
@Component({
selector: 'app-child-widget',
templateUrl: 'child.component.html',
styleUrls: ['./child.component.css']
})
export class ChildComponent implements OnInit …Run Code Online (Sandbox Code Playgroud) 
我有以下HTML
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-body">
<table>
<tbody>
<tr>
<td>
<div class="span2 fileupload fileupload-new pull-left" data-provides="fileupload">
<div class="fileupload-preview thumbnail" style="width: 200px; height: 150px;"></div>
<div> <span class="btn btn-file"><span class="fileupload-new">Select image</span>
<span
class="fileupload-exists">Change</span>
<input type="file" />
</span> <a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>
</div>
</div>
</td>
<td>
<div class="progress">
<div class="bar" style="width: 60%;"></div>
</div>
<button class="btn btn-mini" type="button">Upload</button>
</td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 调节器
@RequestMapping(value = "/graphs", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public Collection<Graph> getSkeletonGraph()
{
log.debug("REST request to get current graphs");
return graphService.getSkeletonGraphs();
}
Run Code Online (Sandbox Code Playgroud)
角度呼叫
$scope.graphs = [];
Graph.getGraphs().$promise.then(function(result)
{
$scope.graphs = result;
});
angular.module('sampleApplicationApp').factory('Graph', function($resource)
{
return {
getGraphs: function() {
return $resource('api/graphs/:id').query();
}
};
})
Run Code Online (Sandbox Code Playgroud)
我不知道为什么使用过滤器我得到了例外.
也看了角度文档https://docs.angularjs.org/error/filter/notarray 我的结果是数组,但不知道为什么我得到这样的异常.
来自后端的示例结果我得到了.
[{"id":"135520b0-9e4b-11e5-a67e-5668957d0149","area":"Bingo","models":[],"enumerateds":[]},{"id":"0db925e0-9e53-11e5-a67e-5668957d0149","area":"jin","models":[],"enumerateds":[]},{"id":"7a717330-9788-11e5-b259-5668957d0149","area":"Product","models":[],"enumerateds":[]},{"id":"402d4c30-980f-11e5-a2a3-5668957d0149","area":"fgfgfg","models":[],"enumerateds":[]},{"id":"404b77b0-9e53-11e5-a67e-5668957d0149","area":"olah","models":[],"enumerateds":[]},{"id":"cd071b10-9e52-11e5-a67e-5668957d0149","area":"lolo","models":[],"enumerateds":[]},{"id":"d9808e60-9710-11e5-b112-5668957d0149","area":"catalog","models":[],"enumerateds":[]},{"id":"2aaca9f0-97e2-11e5-91cd-5668957d0149","area":"btg","models":[],"enumerateds":[]},{"id":"955e9ed0-978c-11e5-93fd-5668957d0149","area":"promotions","models":[],"enumerateds":[]},{"id":"1e441d60-980f-11e5-a2a3-5668957d0149","area":"hjuhh","models":[],"enumerateds":[]},{"id":"fb96dfe0-978d-11e5-93fd-5668957d0149","area":"voucher","models":[],"enumerateds":[]}]
Run Code Online (Sandbox Code Playgroud)
HTML
<li ng-repeat="g in graphs track by $index | filter:searchText"></li>
Run Code Online (Sandbox Code Playgroud) javascript angularjs angularjs-directive angularjs-scope angularjs-ng-repeat
java ×5
angular ×2
angularjs ×1
concurrency ×1
javascript ×1
jhipster ×1
jquery ×1
oop ×1
spring-data ×1
try-catch ×1
typescript ×1