Json and Jquery Demo
Building Project Structure : Download the Google GSON from this link download gson. Create a dynamic web project and put the gson jar file in lib folder of WEB-INF.Refer the screen shot below. JsonDemoServlet : Create a Java Servlet to process request from client (browser) .The response type of the servlet be application/JSON. package com.sandeep.example.servlet;import […]
Escaping Html : Apache Common lang3
Apache Common Lang library provides some Util classes for the developer. One of the mostly used util class is StringEscapeUtil. It has many methods for escaping html,xml,java etc. download apache common lang:- download apache common Project Structure:- Demo Data:- package com.sandeep.apache.common.data;/* * HtmlDataService.java * */public class HtmlDataService { public static String getHtmlString(){ return "Sandeep […]
Apache : PdfBox API
Apache PdfBox Api: Apache pdf-box library is an open source project. This library can be used for creating pdf,extracting text from pdf,bookmarking pdf etc. jar files required:- pdfbox-1.7.1.jar, fontbox-1.7.1.jar, commons-logging-1.1.1.jar . Apache Project Structure: PdfBox Demo java Program: package com.sandeep.pdfbox.demo;import java.io.IOException;import org.apache.pdfbox.exceptions.COSVisitorException;import org.apache.pdfbox.pdmodel.PDDocument;import org.apache.pdfbox.pdmodel.PDPage;import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;import org.apache.pdfbox.pdmodel.font.PDFont;import org.apache.pdfbox.pdmodel.font.PDType1Font;public class PdfBoxDemo { /** * @param args […]
Java Logging
The java logging is present in java.util.logging package. The logging service is useful for developers, administrator and service engineers for their debugging work. Different levels of logging are:- SEVERE (highest value) WARNING INFO CONFIG FINE FINER FINEST (lowest value) Set up the Project :- 5. JavaHtmlLoggerFormatter.java This is a custom formater […]