go to : https://tomcat.apache.org/download-90.cgi
and then download tar.gz file and extract the file and then while running in ecplise needs to provide path for tomcat.
go to : https://tomcat.apache.org/download-90.cgi
and then download tar.gz file and extract the file and then while running in ecplise needs to provide path for tomcat.
Right click on the lombok-1.16.18.jar file and open as Oracle Java 8 Runtime then it will open the pop up window.please specify the ecplise location and update it.
Prerequisites
We build the entire application step by step. Each step is concentrated on a particular functionality.
OK, let’s start.
Step 1. Create a Dynamic Web project in eclipse
File->New->Dynamic web Project
Give the project name as “angularjs-demo” and click finish button.
Step 2. Create the first page index.html
Right click on WebContent folder ->New ->HTML File.
Change the name to index.html and click on finish.
Open index.html and change the <title> as you like. Here I am going to change it to “AngularJs Demo”.
<title>AngularJs Demo</title>
Keep rest everything as it is.
Step 3. Import AngularJs
We can include AngularJS library to our application using ‘script’ tag.
This can be done in two ways.
Step 4. Create module and controller for your application
To begin with AngularJs we need to create two things – Module and Controller.
To put our module and controller code we are going to create a new js file specific to our application.
Create a folder ‘js‘ inside WebContent folder (Right click on WebContent and New->Folder).
Create the file angulardemo.js inside js folder.(Right click on js folder -> New->File).
Add the below code to angulardemo.js file.
var app = angular.module(“demoApp”, []);
app.controller(“demoCtrl”, function($scope) {
$scope.book = “The Alchemist”;
$scope.author = “Paulo Coelho”;
});
We just created a module “demoApp” and a controller for the module “demoCtrl“.
Import the angulardemo.js to index.html just like angular.min.js file.
http://js/angulardemo.js
Now all the files are created. Just to make sure everything is fine, below is folder structure of this application.
Step 5. Bootstrapp the angularJs app
To inject the module into HTML DOM we use ng-app directive. (For now just keep in mind that directive is like an html attribute which does something special. ng-app is one of the many built in directives of AngularJs)
ng-app can be applied to any html element like <html>,<body>,
Above code indicates that all the contents inside this html tag will bind to the module “demoApp”.
Step 6. Display the model data from Controller on View
If we look inside the controller code we will see two variables defined . ie $scope.book and $scope.author. $scope is like a global object which can be accessed by both View and Controller. All the elements in $scope (here the variables book and author) can be directly used in View.
Now are going to add some plain html code to display the model data in view – index.html.Add the below code inside body element.
Book Name | |
Author |
ng-controller is another built-in directive just like ng-app which indicates that model for this
Step 7. Run the application
Running the application is similar to running any other web application in eclipse.
Right click on project->Run As-> Run on Server.. (Hope you have installed Apache/Jetty or any other sever plugins in eclipse)
Hit the url : http://localhost:8080/angularjs-demo/ in your web browser.
If everything works well you will get the below output.
Complete source code
index.html
AngularJs Demo http://lib/angular.min.js http://js/angulardemo.js</body> </html>
Book Name Author
angulardemo.js
var app = angular.module("demoApp", []); app.controller("demoCtrl", function($scope) { $scope.book = "The Alchemist"; $scope.author = "Paulo Coelho"; });
What you’ve seen so far
ng-app : Bootstrap and define angularJs in HTML DOM.
ng-controller : Define a controller for html element.
ng-bind : Bind html elements with model data.
This is just a beginning to AngularJs. There are many other dependent libraries and core components which are used for developing a fully functional website. Hope this is helpful in learning AngularJs. Feel free to share your comments and suggestions. Happy Learning!!
You use a constructor to initialize one instance of a class, the static initialization block initializes static members at the time that the class is loaded.
static block does different thing than constructor . Basically there sre two different concepts.
static block initializes when class load into memory , it means when JVM read u’r byte code. Initialization can ne anything , it can be variable initialization or any thing else which should be shared by all objects of that class
whereas constructor initializes variable for that object only .
reference : https://beginnersbook.com/2013/04/java-static-class-block-methods-variables/
When using NOT IN you should ensure that none of the values are NULL:
SELECT status, creation_date
FROM logs
WHERE logs_type_id=11
AND status NOT IN (
SELECT status
FROM consols
WHERE status IS NOT NULL -- add this
)