this question has answer here: java inner class , static nested class 23 answers i came across in java, know static nested class why create instance of 'static'. isn't whole idea of 'static' use without instance? understand concept of inner classes, why (and frankly how possible to) create 'instance' of 'static' member @ ? why this: 1- outerclass.staticnestedclass nestedobject = new outerclass.staticnestedclass(); 2- nestedobject.anestedclassmethod(); and not this: 1- outerclass outerinstance=new outerclass(); 2- outerinstance.staticnestedclass.anestedclassmethod(); use on inner classes, keyword static indicates can access inner class without instance of outer class. for example: public class outer { public static class inner { /* code here. */ } } with construction, can create instance of inn...
code i have controller method this: @requestmapping("/{userid}/{configid}") def edit(@pathvariable("userid") user user, @pathvariable("configid") configuration configuration) { /* code here*/ } when call method browser works well, , user, , configuration args bind database id. problem but, when used mvcuricomponentsbuilder class, got exceptions incorrect arguments type in expected method. mvcuricomponentsbuilder.frommethodname(mycontroller.class, "edit", 1, 2).build() exception java.lang.illegalargumentexception: source convert must instance of @org.springframework.web.bind.annotation.pathvariable user; instead java.lang.long faced body similar problem? there solution? note : i'm using spring web mvc 4.1.8.release a bit more descriptions i'm using mvcuricomponentsbuilder in thymeleaf template this: th:action="${#mvc.url('cc#edit').arg(0, configuration.access.id).arg(1, configurati...
using mvc entity framework i'm calling function ajax passes in skip , take parameters. [httpget] public async task<actionresult> _viewmore( int take, int skip) { var c = await getcontent( take, skip); return view(c) } public async task<list<partialcontent>> getcontentforculture(int take, int skip) { return await contexthelper.searchcontent(take, skip); } public static async task<list<partialcontent>> searchcontent( int take, int skip) { try { using (var context = new context()) { var content = context.contententities.searchcontent(take, skip); var f = await content.select(s => new partialcontent { subtype = s.subtype, id = s.id, mainimage = s.mainimage, }).tolistasync(); return f; } } catch (exception ex) { // log.err(ex.message, ex); return null...
Comments
Post a Comment