Posts

java - How do I use @Valid to validate local variables? -

this followup question here . how add @valid local variable? here code class authorizationserver : @notblank private string authorizationserverid; @property @indexed(unique = true) @notblank private string authorizationurl; @property(policy = pojomaticpolicy.to_string) @notblank private string clientauthorizationurl; @notblank private string devicerootcert; this controller: byte[] bytes = ioutils.tobytearray(request.getinputstream()); string signature = authorization.split(":")[1]; objectmapper mapper = objectmapper(); authorizationserver authorizationserver = mapper.readvalue(bytes, authorizationserver.class); how validate authorizationserver against annotations declared in authorizationserver class? when tried @valid authorizationserver authorizationserver = mapper.readvalue(bytes, authorizationserver.class); i got error @valid not applicable local variable . i think exception says all. bean validation not...

security - Applets loading very slow on Java 8u 45 with stack overflow error while it works fine with Java 7 -

i getting stackoverflow error on java console while opening applets on network on java version 8 build 1.8.0_45-b15 . applet gets loaded takes around 8 minutes , same works fine in of java 7 versions on network . can please .. stacktrace follows . java.lang.stackoverflowerror @ java.security.accesscontroller.doprivileged(native method) @ sun.security.provider.policyfile.getpermissions(unknown source) @ sun.security.provider.policyfile.getpermissions(unknown source) @ sun.security.provider.policyfile.implies(unknown source) @ java.security.protectiondomain.implies(unknown source) @ java.security.accesscontrolcontext.checkpermission(u i have similar problem , finding. we using applet in firefox. current testing versions: firefox: 46.0.1 java: jre1.8.0_51 (32bit) i used jfr (java flight recorder) , oracle mission control analyse long hang (about 5s) on startup of our ui. my finding far method permissions.implies() takes extremely long unknown reason. my anal...

I want to upload multiple image name in a same row using PHP MYSQL -

here code for ($i = 0; $i < count($_files["user_files"]["name"]); $i++) { // image mime type $image_mime = strtolower(image_type_to_mime_type(exif_imagetype($_files["user_files"]["tmp_name"][$i]))); if (in_array($image_mime, $valid_image_check)) { $foldername = "uploads/"; $ext = explode("/", strtolower($image_mime)); $ext = strtolower(end($ext)); $filename = rand(10000, 990000) . '_' . time() . '.' . $ext; // if user upload file abc,jpg, convert 291905_1399918178.jpg based on random number , time. $filepath = $foldername . $filename; if (!move_uploaded_file($_files["user_files"]["tmp_name"][$i], $filepath)) { echo "fail uplaod"; } else { $smsg .= "<strong>" . $_files["user_files"]["name"][$i] . "</strong> upl...

Directly adding footer in JQuery DataTable -

i want directly add footer jquery datatable, body of table using dt.row.add() method. how possible without using footer callback method? thanks. datatables doesn't seem have api add footer dynamically, if that's want. checks presence of <tfoot> element during initialization only. to add footer dynamically: destroy table destroy() . $('#example').datatable().destroy(); append <tfoot><tr><th></th></tr></tfoot> <table> element making sure you're adding many <th></th> elements there columns in table. re-initialize table same options: $('#example').datatable({ /* options here */ });

css - HTML tags structure -

Image
i'm building webapp following structure : however, i'm not developping web, , know html tags should use enclose different sections of app. should use <header> tags header bar, <nav> menu, <aside> notifications , <article> body, or else? (i'd appreciate if can give me kind of skeleton this) i don't think standard way, recommend looking smacss -- scalable , modular architecture css. https://smacss.com/book/type-layout it's great philosophy on how organize , name css/html. following smacss, divide content based on header, footer, , article. whereas navigation child element of either header or article, can either choose use tag (if navigation remain constant throughout entire web structure), or if it'll flexible , changing, should stick labeling navigation class or id, , not use tag (this ensure can reuse css possible... read entire smacss article more on reusing css , further reading on oocss -- object oriented ...

javascript - Get templateUrl from ui-router -

maybe title isn't clear. i'm working on 2 nested angular apps. both have own router built ui-router . if call state unknown main router, i'd search state in sub-app router templateurl , url related state. i thought creating service parser. parse file find data want. solution not best option have, that's why wanted know if there specific function/method in ui-router achieve it. read on ui-router doc, seems not :/ feel free ask more details or suggest solution can match goal :) you can achieve using dynamic parameters in $stateprovider configuration defined on sub-module. have anchored routes on main module, , if there match, ui-router fetch associated template. if there no matched absolute route/url, ui-router falls on parameterised route, so: // anchored $stateprovider .state('mainappstate', { url: '/anchored', controller: 'myctrl' }) // sub module .state('subappstate', { url: /:parameter res...

asp.net mvc 2 - MVC 2 - Images and CSS do not display on website -

i have 1 mvc2 site not display images , css or allow user login. other mvc 2 sites working fine , have exact same settings application pool. i'm using iis8.5 , windows server 2012 r2. application pool settings managed pipeline mode: integrated identity: application pool identity the website works correctly on own pc. does know how fix this? i got work. turned out duplicate mime types.