Posts

java - the controller is saving the image but the image cannot be found in the desired folder ..is my controller correct -

@controller @requestmapping(value = "/admin/room") public class roomcontroller { @autowired private roomservice roomservice; @requestmapping(method = requestmethod.get) public string index(modelmap map) throws sqlexception { map.addattribute("room", roomservice.getall()); return "admin/room/index"; } @requestmapping(value = "/addroom", method = requestmethod.get) public string addroom() throws sqlexception { return "admin/room/addroom"; } @requestmapping(value = "/editroom/{ro_id}", method = requestmethod.get) public modelandview edit(@pathvariable("ro_id") int ro_id) throws sqlexception { modelandview mv = new modelandview("admin/room/editroom"); mv.addobject("room", roomservice.getbyid(ro_id)); return mv; } @requestmapping(value = "/deleteroom/{ro_id}", method = requestmethod.get) public string delete(@pathvariable("ro_id") int ro_id) t...

asp.net mvc - How to get html of div in controller without post method in mvc -

i new user of mvc. please let me know how access div content inside controller. working on selectpdf. can not use post method using ajax. is there way achieve controller. thanks a div html, presentation user. controller logic called , data pushed view (html) trough objects. you cannot make div inside controller! otherwise, can push data controller view , in view show data in html div!

jquery - show the form response in modal window using Magnific Popup -

i trying submit form using ajax , show response on modal window using magnific popup. have posted code below. in regarding make work have click "send" button "popup" button. playing last 3 hours , couldn't make work. can please see doing wrong? want click send button , see php responses on modal popup window. <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="https://rawgit.com/dimsemenov/magnific-popup/master/dist/jquery.magnific-popup.js"></script> <script type="text/javascript"> jquery(document).ready(function() { $(document).on('click', '.popup-modal', function (e) { $( "#indexform" ).on( "submit", function( event ) { event.preventdefault(); var formdata = $(this).serialize(); $.ajax({ ...

ios - Type of Generic -

can somehow check type of t . want check type array or else. func request<t: mappable>(completionhandler: (result<t>) -> void) { } one way overload method, so: private func request<t: mappable>(isarray: bool, completionhandler: (result<t>) -> void) { if isarray { print("is array") } else { print("is not array") } } func request<t>(completionhandler: (result<array<t>>) -> void) { request(isarray: true, completionhandler: completionhandler) } func request<t: mappable>(completionhandler: (result<t>) -> void) { request(isarray: false, completionhandler: completionhandler) } i'm assuming somewhere have defined: extension array: mappable {}

How to filter the JSON data using AngularJS? -

i have 3 dropdown boxes. need filter data , need displayed in table based on checkbox selection(either single checkbox or two checkboxes or three checkboxes ). i have done following, if observe clearly, not able filter data using angularjs . like: a. should work individual checkbox selection : means if select single checkbox either name or description or field4 , respective matched filtered data should displayed in table, otherwise shouldn't displayed data(i.e if doesn't match our checkbox selection means won't display data) b. should work multiple(two) checkbox selection : means if select multiple checkboxes either one name , one description or one description , one field4 or one field4 , one name , respective matched filtered data should displayed in table, otherwise shouldn't displayed data(i.e if doesn't match our checkbox selection means won't display data) c. should work multiple(three) checkbox selection : means if select 3 chec...

Make the browser wait for api response / http call response in angularjs -

i tried $q service follows browser still not waiting response. spent day figure out solution, tried $timeout . login.controller("loginctrl", ['$scope', '$rootscope', '$filter', '$window', '$http', 'apiservice', 'localstorageservice', 'doalert', '$translate', '$q', '$timeout', function ($scope, $rootscope, $filter, $window, $http, apiservice, localstorageservice, doalert, $translate, $q, $timeout) { $scope.islogout = true; $(window).unload(function () { $rootscope.$broadcast('onunload'); }); $scope.$on('onunload', function (e) { var deferred = $q.defer(); $http.get(url). success(function (data, status, headers, config) { deferred.resolve(data); }). error(function (data, status, headers, config) { deferred.reject(status); ...

java - ANTLR doesn't give correct output tokens for Scala Grammar -

Image
blockquote i new scala , trying parse scala files use of scala grammar , antlr. below code scala grammar got git hub link: https://github.com/antlr/grammars-v4/tree/master/scala there chances of repo moved pasting scala grammar code here: grammar scala; literal : '-'? integerliteral | '-'? floatingpointliteral | booleanliteral | characterliteral | stringliteral | symbolliteral | 'null' ; qualid : id ('.' id)* ; ids : id (',' id)* ; stableid : (id | (id '.')? 'this') '.' id | (id '.')? 'super' classqualifier? '.' id ; classqualifier : '[' id ']' ; type : functionargtypes '=>' type | infixtype existentialclause? ; functionargtypes : infixtype | '...