Skip to main content

Posts

Showing posts with the label JSON

Display data from Json in Angularjs

Problem : I'm using the following code, witch includes the app.js, page.html and data.json The app.js seems to work fine, but the view (page.html) isn't display any data.. HTML : <div ng-controller= "tablesController" style= "padding-left: 15px" > <div class= "ng-scope" > <div class= "row ng-scope" ></div> </div> </div> <div> <md -list flex > <md -list-item class= "md-3-line" ng-repeat= "item in hotelList" ng-click= "null" > <img ng-src= "{{item.hotel_data_node.img_selected.thumb.l}}?{{$index}}" class= "md-avatar" alt= "" /> <div class= "md-list-item-text" layout= "column" > <h3> {{item.hotel_data_node.name}} </h3> Rating : <h4> {{item.hotel_data_node.extra.gir_data.hotel_rating}} </h4> </div> < /md...

Struts 2 action called up twice.

Problem : If you are using JSON plugin with struts2 then you might end up with this problem. your action get called up twice even when you have define it only once  and you are firing ajax only at once. Solution: This is happening because JSON plugin is calling all your methods that start with " get " in an attempt to serialize them for output.Try to rename the method name other then "getxxxxx()". method name start with getXX : public String getName () { return "Rakesh" ; } method name changed to fetchXX : public String fetchName () { return "Rakesh" ; } Hopefully this will work.