Monday 16 December 2013

Testing JAX-WS

Hello friends it's very easy to test soap url's.you should download SOAP-UI plugin from official site of  soap-ui .you can implementation of soap web service as well as restful web service using soap-ui plugin.
(Note: i am using glashfish as an application server)


Steps to follow :
(1) Create new project  from file->new
(2)  Enter name of project & location of wsdl document
(3) select webmethod which you want to test


(4) supply parameters  & test outcome of web method.




thanks
for query ping me on pathak.nisarg@yahoo.com

Sunday 15 December 2013

JAX-WS


JAX-WS

Hello Friends i hope you all are aware of web -services.i am going to demonstrate you simple example of soap web service using glashfish server. before going into details of JAX-ws you need to have understanding of wsdl docuement.when client sends Request it will be soap request & soap response will be returned by container.however in case of Glashfish ,it autogenerates wsdl document.

i personally advice you to go through elements of wsdl document  prior to going into the JAX-WS. some of the elements of WSDL document are <definations>,<operation>,<service>,<porttype>,<binding>,<type> etc.

If i want to make web service than i will simply mark class as @WebService. by default all methods defined in the class will be  exposed as web methods.for detail understanding of JAX-WS go to http://oak.cs.ucla.edu/cs144/reference/WSDL/

i am going to demonstrate you product Catalog Web Service.

Sample Code:
//Model Data
package org.demo.model;

public class Product
{
    private String name;
    private String sku;
    private double price;
   
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSku() {
        return sku;
    }

    public void setSku(String sku) {
        this.sku = sku;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

   
    public Product() { }
   
    public Product(String name,String sku,double price)
    {
        this.name=name;
        this.sku=sku;
        this.price=price;
       
    }
   
   

}

//Service Implementation consisting of bussiness logic

package org.demo.bussiness;

import java.util.*;

import javax.jws.WebMethod;

public class ProductServiceImpl
{
   
    List<String> booklist =new ArrayList<>();
    List<String> musiclist=new ArrayList<>();
    List<String> movielist= new ArrayList<>();

    public ProductServiceImpl()
    {
    booklist.add("Inferno");
    booklist.add("Joyland");
    booklist.add("The Game Of Thrones");

    musiclist.add("Random Access Memories");
    musiclist.add("Night Visions");
    musiclist.add("Unorthodox Jukebox");

    movielist.add("Oz the Great and Powerful");
    movielist.add("Despicable Me");
    movielist.add("Star Trek Into Darkness");
    }
   
    public List<String> getProductCategories()
    {
        List<String> categories = new ArrayList<>();
       
        categories.add("book list");
        categories.add("Music list");
        categories.add("Movie list");
       
        return categories;
       
       
    }
    public List<String> getProducts(String catname)
    {
        switch (catname.toLowerCase()) {
        case "books":
            return booklist;
        case "music":
            return musiclist;
        case "movies":
            return movielist;
        }
        return null;
    }
   
    public boolean addproduct(String  category,String product)
    {
        switch (category.toLowerCase()) {
        case "books":
            booklist.add(product);
            break;
        case "music":
            musiclist.add(product);
            break;
        case "movies":
            movielist.add(product);
            break;
        default:
            return false;
        }
        return true;
       
       
    }


}


//End Point Interface which client will able to see
package org.demo.nisarg;

import javax.jws.WebMethod;
import javax.jws.WebResult;
import javax.jws.WebService;
import java.util.*;

@WebService(name="TestmartCatalog" ,targetNamespace="nisargpathak.blogspot.in")
public interface ProductCatalogInterface
{
   
    @WebMethod(action="fetch_categories", operationName="fetchCategories")
    public List<String> getProductCategories();
   
   
    @WebMethod
    public List<String> getProducts(String productname);
   
    @WebMethod
    public boolean addproduct(String productname,String category);
   
    @WebMethod
    public List<String> getProductv2(String productname);
   

}

//Service First Approach


package org.demo.nisarg;

import java.util.List;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

import org.demo.bussiness.ProductServiceImpl;


@WebService(endpointInterface="org.demo.nisarg.ProductCatalogInterface", portName="TestMartCatalogPort", serviceName="TestMartCatalogService")
public class ProductCatalog implements ProductCatalogInterface
{

    ProductServiceImpl product= new ProductServiceImpl();
   
    @Override
    @WebMethod
    public List<String> getProductCategories()
    {
       
        return   product.getProductCategories();
    }

    @Override
    @WebMethod
    public List<String> getProducts(@WebParam(partName="pName")String productname)
    {
        // TODO Auto-generated method stub
        return product.getProducts(productname);
    }

    @Override
    @WebMethod
    public boolean addproduct(@WebParam(partName="Product-Name")String productname, @WebParam(partName="Category")String category)
    {
        // TODO Auto-generated method stub
        return  product.addproduct(productname, category);
    }

    @Override
    @WebMethod
    public List<String> getProductv2(String productname)
    {
        // TODO Auto-generated method stub
        return product.getProducts(productname);
    }

}


WSDL Document :
definitions targetNamespace="http://nisarg.demo.org/" name="TestMartCatalogService">
<import namespace="www.testmart.com" location="http://nisarg-pc:8080/jax-ws_demo/TestMartCatalogService?wsdl=1"/>
<binding name="TestMartCatalogPortBinding" type="ns1:TestmartCatalog">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>

<operation name="fetchCategories">
<soap:operation soapAction="fetch_categories"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="getProducts">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="addproduct">
<soap:operation soapAction=""/>
<input><soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="getProductv2">
<soap:operation soapAction=""/>
<input><soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="TestMartCatalogService">
<port name="TestMartCatalogPort" binding="tns:TestMartCatalogPortBinding">
<soap:address location="http://nisarg-pc:8080/jax-ws_demo/TestMartCatalogService"/>
</port>
</service>
</definitions>

Run it on Glashfish you can find tester link as well in order to test functionality of web service.

Thanks
for any query Regarding post ping me on pathak.nisarg@yahoo.com

Friday 13 December 2013

SAX(Simple API For XML) parser

SAX(Simple API For XML) parser


Hello Friends .Today i am going to demonstrate you how to parse xml data using SAX(Simple API for XML) parser. The Basic Differance between sax & dom parser is dom parser loads entire document into memory  where as sax parser do not load entire document into memory.so it is convinient way for parsing large xml data.

SAX parser is Event based parser.it does not create representation of xml tree.it simply parse xml data based on Events.we need to write handler class  inorder to keep track of event such as starting of element,ending of element & when character is encountered.

SAX uses some callback methods to parse and read the xml accordingly. It uses three callback methods listed below :

(1)public void startElement(String uri, String localName, String qName,
            Attributes attributes) throws SAXException

(2)public void characters(char[] ch, int start, int length)
            throws SAXException

(3) public void endElement(String uri, String localName, String qName)
            throws SAXException


The Sample code is as given below:


package org.saxdemo;

public class Student
{
   
    private String id;
    private String name;
    private String stream;
   
   
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getStream() {
        return stream;
    }
    public void setStream(String stream) {
        this.stream = stream;
    }
   
   

}

//Handler class
package org.saxdemo;
import java.util.*;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;

public class Handler extends DefaultHandler
{
   
    private Student student;
    public Student getStudent() {
        return student;
    }
    public void setStudent(Student student) {
        this.student = student;
    }
    public List<Student> getStudList() {
        return studList;
    }
    public void setStudList(List<Student> studList) {
        this.studList = studList;
    }
    private List<Student> studList;
   
   
    private boolean  bname;
    private boolean bstream;
   
    @Override
    public void startElement(String uri, String localName, String qName,
            Attributes attributes) throws SAXException
    {
       
        if(qName.equals("student"))
        {
           
            String id=attributes.getValue("id");
            student=new Student();
           
            student.setId(id);
           
            if(studList==null)
            {
                studList=new ArrayList<>();
               
            }
               
           
           
           
        }
        else if(qName.equalsIgnoreCase("name"))
        {
            bname=true;
        }
        else if(qName.equalsIgnoreCase("stream"))
                {
                    bstream=true;
                }
               
    }
    @Override
    public void endElement(String uri, String localName, String qName)
            throws SAXException
   {
       
        if(qName.equalsIgnoreCase("employee"))
        {
        studList.add(student);
        }
       
    }
    @Override
    public void characters(char[] ch, int start, int length)
            throws SAXException
    {
       
        if(bname)
        {
            student.setName(new String(ch,start,length));
           
        }
        if(bstream)
        {
            student.setStream(new String(ch,start,length));
           
        }
       
    }
   
   
}



Sax parser Implementation :
package org.saxdemo;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;
import java.io.*;
import java.util.*;
public class XmlParser
{
    public static void main(String args[])
    {

        //configure sax based parser
        SAXParserFactory saxparserfactory=SAXParserFactory.newInstance();

try
{
   
    //object object for sax based parser
   
       
    SAXParser saxparser=saxparserfactory.newSAXParser();
    Handler handler=new Handler();
//parsing of xml data
    saxparser.parse(new File("D:\\students.xml"), handler);
   
    List<Student> studlist=handler.getStudList();
    for(Student s:studlist)
    {
        System.out.print(s);
       
    }
   
   
}
catch(ParserConfigurationException | SAXException | IOException e)
{
    e.printStackTrace();
   
}
    }

}   

i hope you got my point
for any query & improvement ping me on pathak.nisarg@yahoo.com

Wednesday 11 December 2013

JAXB

JAXB 


Hello Friends.what you will do if you want to marshal /unmarshal java objects ? well,there are 2-3 techniques which comes into your mind that is .(1)Sax Parser,(2)Dom Parser ,(3)JAXB



JAXB is binding api which is used to marshal & unmarshal java objects into/from xml.well the class which is annotated with javax.xml.binding annotations can only be processed by jaxb runtime .so whatever  field you will declare into java class ,that everything is processed by jaxb engine. i am going to show you simple annotations which will be used in code:


@XmlRootElement=> Root Element of xml File

@XmlType(propOrder={"countryname","CountryPopulation","listofStates"}) => Used to specify ordering of xml elements.

@XmlElement=> used to specify xml element .

 JAXB Architecture:

Sample Code :
 package org.demo;

import java.io.File;
import org.apache.commons.logging.log4j.*;
import java.util.*;
import java.util.logging.Logger;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
public class JavatoXml
{
    public static void main(String args[])
    {
      
         //Logger log = Logger.getLogger(
                //JavatoXml.class.getName());
      
            Country india=new Country();
          
            india.setCountryName("India");
            india.setCountryPopulation(5000000);
          
            List<State> states= new ArrayList<State>();
   
            State gujarat=new State();
          
            gujarat.setStatePopluation(6000000);
          
            states.add(gujarat);
          
            //india.setListofstates(states);
            try
            {
                JAXBContext jaxbcontext = JAXBContext.newInstance(Country.class);
              
                    Marshaller  jaxbmarsheller= jaxbcontext.createMarshaller();
                  
                    File f = new File("d:\\ocjp\\CountryRecord.xml");
                  
                    jaxbmarsheller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
                  
                jaxbmarsheller.marshal(india, f);
              
                System.out.println("Xml file created Successfully...!!!");
                  
            }
            catch(JAXBException  e)
            {
              
            }
          
          
    }

}

How Marshelling is done:
(1)
JAXBContext-> It provides an abstractinon for managing infomration necessary to 
implement the jaxb.it informs JAXB runtime that this object or class will be bind into
xml
 
(2) 
Marsheller->it tells JAXB runtime to marshell given instance of class.
 
 
Sample Code:
 

package org.demo;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.util.*;


@XmlRootElement

@XmlType(propOrder={"countryname","CountryPopulation","listofStates"})




public class Country
{
 
 
 @XmlElement
 private String countryName;
 @XmlElement
 private double countryPopulation;
 @XmlElement
 private ArrayList<State> listofstates;
 
 public Country() { }
 
 public String getCountryName() {
  return countryName;
 }

 @XmlElement
 public void setCountryName(String countryName) {
  this.countryName = countryName;
 }

 public double getCountryPopulation() {
  return countryPopulation;
 }

 @XmlElement
 public void setCountryPopulation(double countryPopulation) {
  this.countryPopulation = countryPopulation;
 }

 public ArrayList<State> getListofstates() 
 {
  return listofstates;
 }

 @XmlElementWrapper(name="stateList")
 @XmlElement(name="state")
 public void setListofstates(ArrayList<State> listofstates) {
  this.listofstates = listofstates;
 }

 
 
 
 
 

}
package org.demo;

import javax.xml.bind.annotation.XmlRootElement;



@XmlRootElement(namespace="org.demo.Country")
public class State
{
 
 private String statename;
 private long statePopluation;
 
 
 public State() { }
 public String getStatename() {
  return statename;
 }
 public void setStatename(String statename) {
  this.statename = statename;
 }
 public long getStatePopluation() {
  return statePopluation;
 }
 public void setStatePopluation(long statePopluation) {
  this.statePopluation = statePopluation;
 }

 
 

}


package org.demo;

import java.io.File;
import org.apache.commons.logging.log4j.*;
import java.util.*;
import java.util.logging.Logger;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
public class JavatoXml 
{
 public static void main(String args[])
 {
  
   Country india=new Country();
   
   india.setCountryName("India");
   india.setCountryPopulation(5000000);
   
   List<State> states= new ArrayList<State>();
 
   State gujarat=new State();
   
   gujarat.setStatePopluation(6000000);
   
   states.add(gujarat);
   
   //india.setListofstates(states);
   try
   {
    JAXBContext jaxbcontext = JAXBContext.newInstance(Country.class);
    
     Marshaller  jaxbmarsheller= jaxbcontext.createMarshaller();
     
     File f = new File("d:\\ocjp\\CountryRecord.xml");
     
     jaxbmarsheller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,true);
     
    jaxbmarsheller.marshal(india, f);
    
    System.out.println("Xml file created Successfully...!!!");
     
   }
   catch(JAXBException  e)
   {
    
   }
   
   
 }

}

this is how java object is marshaled into xml .

thanks
for any query ping me on pathak.nisarg@yahoo.com
 
 
 
 
 
 
 
 
 

Tuesday 10 December 2013

Jackson Steaming API

Jackson Steaming API
Hello friends.hope you are fine  .today i am going to demonstrate how to process json data.there are various API's available in market ,here i am going to demonstrate you Jackson Streaming API Code.

it is  API used for processing json data.how ever it process the data/token  in incremental manner. it treats individual token as a element.it is faster & convinient way of processing json data.

below sample code  creates json file using Jackson Streaming API:


package org.demo;
import java.io.File;
import java.io.IOException;

import org.codehaus.jackson.JsonEncoding;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerator;

public class JacksonReader
{

        public static void main(String []args) throws IOException
        {
            JsonFactory jfactory =new JsonFactory();
           
            JsonGenerator jgenerator=jfactory.createJsonGenerator(new File("D:\\ocjp\\Data.json"),JsonEncoding.UTF8);//used to write data in streaming way
           
                jgenerator.writeStartObject();//{
               
                jgenerator.writeStringField("Name","Akshita");//"Name":Akshita
               
                jgenerator.writeNumberField("Age",21);//"Age":21
               
       jgenerator.writeFieldName("hobby");//"messages" 
                jgenerator.writeStartArray(); //[
               
                jgenerator.writeString("Reading");//"Reading"
                jgenerator.writeString("Coding");//"Coding"
                jgenerator.writeString("Surfing");://"Surfing"
               
               
                jgenerator.writeEndArray(); //]
               
               
                jgenerator.close();//close the document
               
       
       
        }
}

Sample data.json file that will be generated after compiliation of the above code:

{ "Name":Akshita
 "Age":21 ,
"hobby":["Reading","Coding","Surfing"]
};

below code show how to read json data from json file:

import java.io.File;
import java.io.IOException;
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;
import org.codehaus.jackson.map.JsonMappingException;

public class JacksonStreamExample {
   public static void main(String[] args) {

     try {

    JsonFactory jfactory = new JsonFactory();

    /*** read from file ***/
    JsonParser jParser = jfactory.createJsonParser(new File("D://ocjp//Data.json"));

    // loop until token equal to "}"
    while (jParser.nextToken() != JsonToken.END_OBJECT) {

        String fieldname = jParser.getCurrentName();
        if ("Name".equals(fieldname)) {

         
          jParser.nextToken();
          System.out.println(jParser.getText());

        }

        if ("age".equals(fieldname)) {

         
          jParser.nextToken();
          System.out.println(jParser.getIntValue()); // display 29

        }

        if ("hobyy".equals(fieldname)) {

          jParser.nextToken(); // current token is "[", move next

          // messages is array, loop until token equal to "]"
          while (jParser.nextToken() != JsonToken.END_ARRAY) {

                     // display Reading,Surfing
             System.out.println(jParser.getText());

          }

        }

      }
      jParser.close();

     } catch (JsonGenerationException e) {

      e.printStackTrace();

     } catch (JsonMappingException e) {

      e.printStackTrace();

     } catch (IOException e) {

      e.printStackTrace();

     }

  }

}

thanks
for any query ping me on pathak.nisarg@yahoo.com

Saturday 7 December 2013

Resource Injection (Using javax.annotation.Resource)


Resource Injection Using javax.annotation.Resource  



Basically we can inject
(1)Mail Session,
(2)Data Source,
(3)Jndi Resource it can be simple text or it can be beans etc.

Here i am going to Demonstrate MailSession Injection using glashfish server:


Hello friends.hope you all are fine.in this post i am going to demonstrate you how to inject MailSession that has been configured in glashfish server.i hope you are aware of how to define Java MailSession using glashfish server.

if you are not familiar with how to configure java mail session into glashfish than i should advice you to go through http://javaeenotes.blogspot.in/2010/04/using-javamail-api-with-glassfish-and.html.


i am posting sample code you can modify the below code as per the requirement:




package org.demo.Mail;

import javax.annotation.Resource;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import java.util.*;


public class MailSender
{

    /**
     * @param args
     * @throws NamingException
     * @throws MessagingException
     */

//refers to myMailSession that has been configured in glashfish server.
    @Resource(name="mail/myMailSession")
    Session mailSession;
   
    public static void main(String[] args) throws NamingException, MessagingException
    {
       
       
       
               
       
        InitialContext ic = new InitialContext();//create the initcontext object
       

MyMailSession=Java Mail Session that has been configured into  Glashfish server.
        String snName = "java:comp/env/mail/MyMailSession";

       
       
        Session session = (Session)ic.lookup(snName);//get the resource from global JNDI
       
       
        Properties  props=session.getProperties();//get the Properties that you have defined in glashfish
       
       
        props.put("mail.from","********@gmail.com");//append extra property
        //[Note: when you are configuring properties you are configuring it as a mail-session which is interally converted into mail.session by server.so whatever property you want to define you can define it as a property-name pair.
       
        Message msg =new MimeMessage(session);//create message with Session


        msg.setSubject("Reminder");
           
        msg.setSentDate(new Date());
       
        msg.setRecipients(Message.RecipientType.TO,
                   InternetAddress.parse("****@gmail.com", false));
       
   
        msg.setText("hey guyzz");
       
        Transport.send(msg);
       
       
       
       
       
    }

}



Thanks a lot
for any query ping me on pathak.nisarg@yahoo.com

Sunday 1 December 2013

Spring Mail Sender example

Sample Mail Sending Implementation  Using spring 3.0

hello friends i am going to present you a simple example of  how to send mail using spring.however you can also use java mail api to send mails.but spring is also providing inbuilt classes and interfaces through which you can send mail.

i am going to show you simple example of sending mail using gmail server .here it is:






package org.demo.mail;

import javax.annotation.Resource;
import javax.mail.MessagingException;
import javax.mail.Session;
import javax.mail.internet.MimeMessage;
import javax.naming.InitialContext;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.mail.MailParseException;
import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.mail.javamail.MimeMessagePreparator;
import org.springframework.stereotype.Service;




@Service("mailService")
public class MailSendingService
{
   
     
    @Autowired
    private MailSender mailSender;
   
 
    private SimpleMailMessage preConfiguredMessage;
   
   
   
   
   
    public void sendMail(String to,String subject,String body)
    {
   
       
        SimpleMailMessage message=new SimpleMailMessage();
       
       
   
        message.setTo(to);
        message.setSubject(subject);
        message.setText(body);
       
        mailSender.send(message);
       
               
       
       
    }
   
    public void sendPreConfiguredMail(String message)
    {
        SimpleMailMessage sm=new SimpleMailMessage(preConfiguredMessage);
       
       
        sm.setText(message);
        mailSender.send(sm);
       
       
       
    }
   
   
   
   

}


Client class:
package org.demo.mail;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MailClient
{
   
    public static void main(String args[])
    {
   
        ApplicationContext context=new ClassPathXmlApplicationContext("Spring-Config.xml");
   
    MailSendingService mailer=(MailSendingService)context.getBean("mailService");
   
    mailer.sendMail("*******@gmail.com", "hi", "Done");
   
   
    mailer.sendPreConfiguredMail("Exception,try again ...!!! ");
   
   
 ;
   
   
   
   
    }

}


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd


http://www.springframework.org/schema/context


http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<context:component-scan base-package="org.demo.mail">

</context:component-scan>




<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">

         <property name="host" value="smtp.gmail.com"/>
        <property name="port" value="25"/>
        <property name="username" value="*********@gmail.com"/>
        <property name="password" value="**********"/>
        <property name="javaMailProperties">   
            <props>
                <prop key="mail.transport.protocol">smtp</prop>
                <prop key="mail.smtp.auth">true</prop>
                <prop key="mail.smtp.starttls.enable">true</prop>
                <prop key="mail.debug">true</prop>
            </props>
        </property>
       
        </bean>
       
       
       
       
       

<bean id="preConfiguredMessage" class="org.springframework.mail.SimpleMailMessage">

<property name="to" value="********@gmail.com"></property>
<property name="from" value="*******@gmail.com"></property>
<property name="subject" value="Fatal"></property>
</bean>

</beans>

thanks
for any query ping me @  pathak.nisarg@yahoo.com

Spring Boot SSL configuration -Tomcat Server

Hi Friends hope you all are doing well. Today I am going to demonstrate about how to configure SSL in Spring boot web Application. Need o...