Posts

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