Posts

Showing posts from March, 2017

Creating a Spring MVC project

Image
In Eclipse, click menu  File > New > Maven Project  (or  File > New > Other… > Maven Project ). The  New Maven Project  dialog appears: Make sure you don’t check the option  Create a simple project (skip archetype selection) , and click  Next .  In the next screen,  Select an Archetype , you may see a lot of archetypes in the list, so type  spring-mvc  into the  Filter  textfield to filter out the list, as shown below: If you don’t see the  spring-mvc-archetype , click the  Add Archetype…  button. In the  Add Archetype  dialog, type the following information: Archetype Group Id:  co.ntier Archetype Artifact Id:  spring-mvc-archetype Archetype Version:  1.0.2 Repository URL:  http://maven-repository.com/artifact/co.ntier/spring-mvc-archetype/1.0.2   Click  OK  and wait for a moment while Eclipse is downloading the archetype. Fi...

Create Dynamic Web Project

Image
Select from the menu File --> New --> Dynamic Web Project. Enter "HelloWorldJSP" as the project name. Keep rest of the settings as it is as shown in the following screenshot. Click "Next" button. Click "Next" button. Check 'Generate web.xml deployment descriptor' checkbox and click "Finish" .  2. Create Jsp page Right click on 'WebContent' folder and select from context menu New --> Jsp File. Write "helloWorld.jsp" in the 'File Name' field and Click "Finish" button. Eclipse will generate a jsp page and open the same in the JSP editor as shown below File: helloWorld.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1"     pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd "...

Import a GitHub project into Eclipse

Image
First, you have to add the git repository to Eclipse. 'Window > Show views > Other > Git > Git Repositories'  2. Click on  'Clone a Git repository'  to begin the process. Make sure to select GitHub as repository source. To add your project, enter the name of the project (select the language, if you set one) and press search. Your project repository will show up. Select it and press  'Next' . Now, select the local path on your computer where Eclipse will store the project. In my case, I'm OK with the default path, that is, within the  git/  subfolder in my home dir (i.e.,  C:\Users\Fabio\git\socialcde-demo ). Please, make sure to check the box  'Import all existing Eclipse project after clone finishes' . This is very important if the project on GitHub is not empty. Then, press  'Finish' . In the rest of this guide, I'm assuming that your GitHub project is empty and has jus...

HTML DOM

Image
Browser Flow CSS Flow

JQuery

Coming Soon

AngularJs

Coming Soon

Debugging Programs in Eclipse

Image
Write a Java Program Factorial Number /** Compute the Factorial of n, where n=20. * n! = 1*2*3*...*n */ public class Factorial { public static void main(String[] args) { int n = 20; // To compute factorial of n int factorial = 1; // Init the product to 1 int i = 1; while (i <= n) { factorial = factorial * i; i++; } System.out.println("The Factorial of " + n + " is " + factorial); } } Set an Initial Breakpoint Start Debugger Right click anywhere on the source code (or from the "Run" menu) ⇒ "Debug As" ⇒ "Java Application" ⇒ choose "Yes" to switch into "Debug" perspective (A  perspective  is a particular arrangement of panels to suits a certain development task such as editing or debugging). Step-Over and Watch the Variables and Outputs & Breakpoint, Run-To-Line, Resume and Terminate

Writing your First Java Program in Eclipse

Launch Eclipse Launch Eclipse by running " eclipse.exe " from the Eclipse installed directory. Choose an appropriate directory for your  workspace , i.e., where you would like to save your files (e.g.,  d:\myproject\eclipse  for Windows). If the "Welcome" screen shows up, close it by clicking the "cross" button next to the "Welcome" title. Create a new Java Project Choose "File" menu ⇒ "New" ⇒ "Java project". The "New Java Project" dialog pops up. In "Project name", enter " FirstProject ". Check "Use default location". In "JRE", select "Use default JRE (currently 'JDK1.8.xx')". But make sure that your JDK is 1.5 and above. In "Project Layout", check "Use project folder as root for sources and class files" Push "Finish" button. Write a Hello-world Java Program In the "Package Explorer" (l...

Eclipse Installation

Image
Install JDK Download JDK Goto Java SE download site @  http://www.oracle.com/technetwork/java/javase/downloads/index.html . Under "Java Platform, Standard Edition" ⇒ "Java SE 8u{xx}", where {xx} is the latest update number ⇒ Click the "JDK Download" button. Look for the latest "Java SE Development Kit 8u{xx}" ⇒ Check "Accept License Agreement". Choose the JDK for your operating system, e.g., "Windows x64" (for 64-bit Windows OS) or "Windows x86" (for 32-bit Windows OS). You can check whether your Windows OS is 32-bit or 64-bit via "Control Panel" ⇒ (Optional) System and Security ⇒ System ⇒ Under "System Type". Install JDK and JRE Run the downloaded installer (e.g., " jdk-8u{xx}-windows-x64.exe "), which installs both the JDK and JRE.  By default, the JDK will be installed in directory " C:\Program Files\Java\jdk1.8.0_ xx ", where  xx  denotes the upgrade number; ...

Web Application Structure

Image