Posts

Showing posts from July, 2013

Send Email from Java program using apache common email

Commons Email aims to provide a API for sending email. It is built on top of the Java Mail API, which it aims to simplify. Some of the mail classes that are provided are as follows: SimpleEmail  - This class is used to send basic text based emails. MultiPartEmail  - This class is used to send multipart messages. This allows a text message with attachments either inline or attached. HtmlEmail  - This class is used to send HTML formatted emails. It has all of the capabilities as MultiPartEmail allowing attachments to be easily added. It also supports embedded images. ImageHtmlEmail  - This class is used to send HTML formatted emails with inline images. It has all of the capabilities as HtmlEmail but transform all image references to inline images. EmailAttachment  - This is a simple container class to allow for easy handling of attachments. It is for use with instances of MultiPartEmail and HtmlEmail. A simple text email ...

How to create a self-signed SSL Certificate

How to create a self-signed SSL Certificate The following is an extremely simplified view of how SSL is implemented and what part the certificate plays in the entire process. Normal web traffic is sent unencrypted over the Internet. That is, anyone with access to the right tools can snoop all of that traffic. Obviously, this can lead to problems, especially where security and privacy is necessary, such as in credit card data and bank transactions. The Secure Socket Layer is used to encrypt the data stream between the web server and the web client (the browser). SSL makes use of what is known as  asymmetric cryptography , commonly referred to as  public key cryptography (PKI) . With public key cryptography, two keys are created, one public, one private. Anything encrypted with either key can only be decrypted with its corresponding key. Thus if a message or data stream were encrypted with the server's private key, it can be decrypted only using its cor...

Generate reports dynamically using Jasper Reports without generating a jasper for each report

You can Generate reports dynamically using Jasper Reports without generating a jasper for each report , For basic and generating report using Jasper use this link  ireport package com.imlog.report; import java.sql.Connection; import java.sql.DriverManager; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.HashMap; import java.util.Map; import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JasperCompileManager; import net.sf.jasperreports.engine.JasperExportManager; import net.sf.jasperreports.engine.JasperFillManager; import net.sf.jasperreports.engine.JasperPrint; import net.sf.jasperreports.engine.JasperReport; import net.sf.jasperreports.engine.design.JRDesignBand; import net.sf.jasperreports.engine.design.JRDesignExpression; import net.sf.jasperreports.engine.design.JRDesignQuery; import net.sf.jasperreports.engine.design.JRDesignSection; import net.sf.jasperreports.e...