Posts

spring boot - loading dynamic image from local source -

i have saved images local path of pc , saved file name db. want load image db , show html page using java script , thymemleaf. browser says not allowed load local resources , made servlet in spring boot. not showing image. servlet @webservlet("/admin/imgservlet") public class adminimageservlet extends httpservlet { private static final long serialversionuid = 1l; @override public void doget(httpservletrequest request, httpservletresponse response) throws ioexception { string urlimage = request.getparameter("admin"); response.setcontenttype("image/jpeg"); servletoutputstream out; out = response.getoutputstream(); fileinputstream fin = new fileinputstream("c:/users/public/documents/" + urlimage); bufferedinputstream bin = new bufferedinputstream(fin); bufferedoutputstream bout = new bufferedoutputstream(out); int ch = 0; while ((ch = bin.read()) != -1) { ...

java - The error doesn't happen while importing in the local Database -

Image
i importing json files database. java.lang.nullpointerexception files. on tracing error, see error occurs in last_name column of database. of names "heldeweg, m.a.","schlössels, r.j.n.","seerden, r.j.g.h." and last names heldeweg, schlössels, seerden which extract names array. but when try import same files local database, files imported without issues. don't seem know how trace error causing java.lang.nullpointerexception error. i added screenshot of error. tell me part of code @ identify location of error? thanks help!!!

Android webview javascript Interface not working properly -

really not have ideal why doesn't work. basically, trying this. public void testjs() { final webview webview = (webview) findviewbyid(web); // webview.getsettings().setdomstorageenabled(true); webview.getsettings().setjavascriptenabled(true); webview.addjavascriptinterface(new jsinterface(webview), "sample"); webview.setwebchromeclient(new webchromeclient() { @override public boolean onjsalert(webview view, string url, string message, jsresult result) { /* whatever need here */ log.e("chrome", "asdf"); return super.onjsalert(view, url, message, result); } }); webview.loadurl("javascript:window.sample.doechotest();void(0);"); } and jsinterface public class jsinterface { webview mappview; public jsinterface(webview appview) { this.mappview = appview; } ...

javascript - Fire event on repeat done in AngularJS -

hello trying fire event on repeat done in angularjs, following code: following html code <li ng-repeat="y in names | limitto: 6" repeat-done="ratingwithng()"> <a href="<?php echo $this->config->item('search_url');?>{{y.hosurl}}"> <div class="hospital-card"> <img src="{{y.profile_image}}" width="" height="" /> <h3 class="vlcc-name">{{y.clinic_name}}</h3> <div class="doc-rete"> <div id="rateyo-hos" class="mc-doc-rating">3</div> </div> <p class="hospital-specialist">{{y.localty }} {{y.city }}</p> <p class="vlcc-experince">{{y.clinic_type }}</p> <p class="vlcc-address">{{y.hos_time }} </p> </div> </a> </li> following angularjs code: var app = angular.module('myapp',...

upload video to youtube using php -

i beginner in php. want upload video on youtube using php. http error 404 occurs while running demo . here demo link used . http://www.codexworld.com/upload-video-to-youtube-using-php/ and created oauthclientid , oauthclientsecret google accounts. , put under config file. <?php // oauth configuration $oauthclientid = 'xxxxx'; $oauthclientsecret = 'xxxxxxx'; $baseuri = 'http://example.com/upload-video-to-youtube-using-php/'; $redirecturi = 'http://example.com/upload-video-to-youtube-using-php/youtube_upload.php'; define('oauth_client_id',$oauthclientid); define('oauth_client_secret',$oauthclientsecret); define('redirect_uri',$redirecturi); define('base_uri',$baseuri); // include google client libraries require_once 'src/google/autoload.php'; require_once 'src/google/client.php'; require_once 'src/google/service/youtube.php'; ...

rest - java:Tomcat 9 status code 200 but response message null -

i have http client sends request restful web service , receives response. working when deployed in tomcat 8. when tried deploy same client , server in tomcat versions 8.5 , above, server receives response code 200 response message null instead of ok. below client code snippet httpclient = httpclientbuilder.create().build(); postrequest.setentity(new urlencodedformentity(urlparameters)); httpresponse response = httpclient.execute(postrequest); httpentity entity = response.getentity(); system.out.println("response server "); system.out.println(response.getstatusline().getstatuscode()); system.out.println(response.getstatusline().getreasonphrase()); and server code snippet response @post @path("/download/{filename}") @produces(mediatype.application_octet_stream) public response getfile(@pathparam("filename") string file) { try { file downloadfile = new file(...

android - Load album art into Glide using Listview -

code load album art if(cursor != null && cursor.movetofirst()){ int titlecolumn = cursor.getcolumnindex(mediastore.audio.media.title); int idcolumn = cursor.getcolumnindex(mediastore.audio.media._id); int artistcolumn = cursor.getcolumnindex(mediastore.audio.media.artist); int albumcolumn = cursor.getcolumnindex(mediastore.audio.media.album); long albumid = cursor.getcolumnindex(mediastore.audio.albums.album_id); { long thisid = cursor.getlong(idcolumn); string thistitle = cursor.getstring(titlecolumn); string thisartist = cursor.getstring(artistcolumn); string thisalbum = cursor.getstring(albumcolumn); glide.with(this) .load(albumid) .asbitmap() .into() //how return value? medialist.add(new songinfo(thisid, thistitle, thisartist, thisalbum, //bitmap variable)); } while...