About the Author

Hi this is Sri Harishkumar reddy,Working as a Senior Software Engineer in one of the MNC company.Haveing experiance on Java,JEE,Spring,Springboot,HTML,CSS,MongoDB,MySQL,Oralcle,JavaScript,jQuery,Amazon WebServices,AngularJs

How to Configure SSL in Tomcat server(Enabling https)

No comments:
Today i am going to explain you how to configure SSL in tomcat windows OS.
These are the steps you have to follow.


1.Press Windows Button + R and type cmd command prompt will open.


2.copy java root path(cd C:\Program Files\Java\jdk1.8.0_25\bin).






3.then type keytool -genkeypair -alias MyCertificate -keyalg RSA -keystore "C:\Users\SRI HARISH\MyCertificate.cert"



4.Enter keystore password : harish (enter your password).
5.Re-enter keystore password : harish (enter your password).
6.what is  your first and last name : harishkumar reddy(enter your first and last name).
7.what is the name of your organizational unit : IT(enter your organizational unit).
8.what is the name of your city and locality : bangalore(enter your city and locality).
9.what is the name of your state and province : karnataka(enter your state and province).
10.what is the name of two-letter country code for this unit : 91(for india 91 enter your state and province).
11.and verity and enter YES.


12.enter key password for <MyCertificate>(RETURN if same as keystore password):harish(enter your password).
13.Re-enter key new password :harish(enter your password).
14.after that if you see java root directory(C:\Program Files\Java\jdk1.8.0_25\bin) it is coreated sussceefully without any error.


15.open the file generated location(C:\Users\SRI HARISH) and you will see MyCertificate.cert file.
16.open server.xml(located in tomcat : C:\tomcat8\conf\server.xml),search for port="8443" you would see the code was commented below like this.



17.enabel the comment and add the keystoreFile(keystoreFile="C:\Users\SRI HARISH\MyCert.cert") location and password(keystorePass="harish") below like this.



18.save the file and restart the server and java (if startrd)
19.start the java and tomcat server
20.open the browser and type the url like this (https://localhost:8443/) you will see below waring (
There is a problem with this website’s security certificate.)


21.click on (There is a problem with this website’s security certificate.)
22.you will see running tomcat with https protocal.

if you have any problem please comment below.
Like and Follow Us on facebook

Collection ArrayList Example with ForEach Loop,Iterator,ListIterator

No comments:

Example :

package com.harish.collections;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.ListIterator;

public class ArrayListDemo {
public static void main(String[] args) {
ArrayList<Integer> al = new ArrayList<Integer>();
al.add(10);
al.add(20);
al.add(30);
al.add(40);
al.add(50);
al.add(60);
al.add(70);

System.out.println("ArrayList : " + al);
System.out.println("\n");

System.out.println("I am Running ForEach Loop");
for (int itr : al) {
System.out.println("For Loop :" + itr);
}
System.out.println("\n");

System.out.println("I am Running Iterator");

Iterator<Integer> alitr = al.iterator();
while (alitr.hasNext()) {
Integer itrinteger = (Integer) alitr.next();
System.out.println("Iterator : " + itrinteger);
}

System.out.println("\n");

System.out.println("I am Running List Iterator");

ListIterator<Integer> litr = al.listIterator();
while (litr.hasNext()) {
Integer lstitrinteger = (Integer) litr.next();
System.out.println(" List Iterator : " + lstitrinteger);
}
System.out.println("\n");

System.out.println("I am Running List Iterator Previous");

while (litr.hasPrevious()) {
Integer integer = (Integer) litr.previous();
System.out.println(" List Iterator Previous: " + integer);
}
System.out.println("\n");

System.out.println("I am Removing First Element");

al.remove(0);

System.out.println(al);

System.out.println("\n");

System.out.println("I am Adding Element");

al.add(80);

System.out.println(al);

System.out.println("\n");

System.out.println("I am Setting First Element");

al.set(0, 100);

System.out.println(al);

}
}

Output:

ArrayList : [10, 20, 30, 40, 50, 60, 70]


I am Running ForEach Loop
For Loop :10
For Loop :20
For Loop :30
For Loop :40
For Loop :50
For Loop :60
For Loop :70


I am Running Iterator
Iterator : 10
Iterator : 20
Iterator : 30
Iterator : 40
Iterator : 50
Iterator : 60
Iterator : 70


I am Running List Iterator
 List Iterator : 10
 List Iterator : 20
 List Iterator : 30
 List Iterator : 40
 List Iterator : 50
 List Iterator : 60
 List Iterator : 70


I am Running List Iterator Previous
 List Iterator Previous: 70
 List Iterator Previous: 60
 List Iterator Previous: 50
 List Iterator Previous: 40
 List Iterator Previous: 30
 List Iterator Previous: 20
 List Iterator Previous: 10


I am Removing First Element
[20, 30, 40, 50, 60, 70]


I am Adding Element
[20, 30, 40, 50, 60, 70, 80]


I am Setting First Element
[100, 30, 40, 50, 60, 70, 80]

How to Use Google Maps For Your Own Business

Posted in
No comments:
Now a days google maps is playing major role in all industries like searching Historical places,Hospital,Schools,Directions from one location to another location etc.

many of the companies are using google maps to track their vehicles like in courier tracking,transport vehicle tracking,many transportation companies like Uber,Ola etc.

How they are using google maps into their own applications.

Here i am going to explain in detail how to use google maps in our own applications without any others help by basic knowledge on HTML5,CSS,Javascript.

To implement this feature in our applications google is providing API for free of cost for us.we can use those API and implement.To start learning this we need to follow the basic steps.

Step 1:

First we need to create one HTML5 page.To create this page you need to open Note Pad and write <!DOCTYP html>.

Step 2:

Now we need use the API which is provided by the Google in head Tag.

<head>
<script src="https://maps.googleapis.com/maps/api/js?callback=initMap"></script>
</head>

Step 3:

To Show or Hold the map on html page you have to create one div tag with an id. then you have to set the height and width of the map.

<div id="jtcmap" width="500px" height="500px">

Step 4:

After you have to assign the map to div id tag to show on html page.


This is full code and like Example For Simple Google Maps:

<!DOCTYPE html>
<html>
  <head>
    <title>Java T Cup Map</title>
    <script src="https://maps.googleapis.com/maps/api/js?callback=initMap" async defer></script>

  <style>
  #jtcmap{
  height:500px;
  width:500px;
  }
  </style>
  </head>
  <body>
    <div id="jtcmap"></div>
    <script>

var map;
function initMap() {
  map = new google.maps.Map(document.getElementById('jtcmap'), {
    center: {lat:12.9667,lng:77.5667},
    zoom: 8
  });
}

    </script>
  </body>
</html>

Result:


Java T Cup Map
© 2016 Java T Cup. Designed by Java T Cup
Proudly Powered by Blogger.