Category: Java Frameworks
Anonymous Inner Classes in Java
Using Anonymous Inner Classes in Java: Before getting into the depth of Anonymous inner classes, let’s understand a bit about inner classes first. As the name implies, a class which is declared and defined inside another class just like a
Java | Static and Non-Static Inner classes
Static and Non-Static Inner classes: Static Nested Classes: Static Nested Classes are the static classes in Java which are created inside another outer class. As these are declared inside another class with keyword ‘static’, therefore they are treated like the
Javascript | Adding days to date string and displaying in specific format
Suppose we want to add a number of days to given date string. For this, it can be done as follows: var givenDateString = “2016-10-10”; var dateObj = new Date(givenDateString); // Converting date string to date Object to perform any
Java Struts | How to remove the action extension in Struts 2 framework
In struts.xml file of your web project, replace value for constant named “struts.action.extension” to as shown below : <struts> <constant name = “struts.action.extension” value=”,”> </constant> <!– we have set value for this constant to comma that means no extension as
Adding custom merge tags to the Gravity forms
Merge Tags in gravity forms are the tags that are used to dynamically populate the field values in the form content in gravity forms like IP address, browser name, logged in user name etc . There are many merge tags
Java | Method overriding and exceptions
Problem: Suppose you have a method M1 in class A that throws exception E1 and you override this method in class B (B extends A). Are there any rules about exceptions when methods are overridden? Solution: There are following rules
Javascript | How to call ajax in DevExtreme component using angularjs
var folderApp = angular.module(“folder”, [“dx”]); folderApp.controller(“folderController”, [“$scope”, “$http”, function($scope, $http) { $scope.gridSettings = { columns: [{ dataField: “myObjectName”, caption: “Name”, } { dataField: “myObjectEmail”, caption: “Email”, }], dataSource: new DevExpress.data.CustomStore({ load: function(loadOptions) { return $http({ method: “GET”, url: ” ”;
Java | Hibernate best practices
1. Always define hashCode() and equals() methods in your Persistent classes. 2. Persistent class method’s equals() and hashCode() must access its fields through getter methods. It is a good practice to use accessor methods instead of direct instance variable access.
Importing gmail contacts in your website using javascript
Importing gmail contacts in external website is common these day where you can login to gmail from within external website and then access your contacts directly inside external website. For example, the requirement could be to allow user to refer