Posts

Showing posts from June, 2016

Jason and Logger in java

JSON package main.java ; import java.io.DataInputStream ; import java.io.IOException ; import java.util.Scanner ; import java.util.logging.FileHandler ; import java.util.logging.Logger ; import java.util.logging.SimpleFormatter ; public class LoggerDemo { public static void main (String args[]) throws Exception{ Logger logger=Logger. getLogger (LoggerDemo. class .getName()) ; try (Scanner scanner= new Scanner(System. in )) { int a=scanner.nextInt() ; FileHandler fileHandler = new FileHandler( "/Users/mohan/IdeaProjects/Logger/Log.log" ) ; FileHandler fileHandler1= new FileHandler( "/Users/mohan/IdeaProjects/Logger/Log1.log" ) ; FileHandler fileHandler2= new FileHandler( "/Users/mohan/IdeaProjects/Logger/Log2.log" ) ; logger.addHandler( fileHandler ) ; logger.addHandler(fileHandler1) ; logger.addHandler(fileHandler2) ; logger.getL...

A view About Logger and json In java

package main.java ; import java.io.DataInputStream ; import java.io.IOException ; import java.util.Scanner ; import java.util.logging.FileHandler ; import java.util.logging.Logger ; import java.util.logging.SimpleFormatter ; public class LoggerDemo { public static void main (String args[]) throws Exception{ Logger logger=Logger. getLogger (LoggerDemo. class .getName()) ; try (Scanner scanner= new Scanner(System. in )) { int a=scanner.nextInt() ; FileHandler fileHandler = new FileHandler( "/Users/mohan/IdeaProjects/Logger/Log.log" ) ; FileHandler fileHandler1= new FileHandler( "/Users/mohan/IdeaProjects/Logger/Log1.log" ) ; FileHandler fileHandler2= new FileHandler( "/Users/mohan/IdeaProjects/Logger/Log2.log" ) ; logger.addHandler( fileHandler ) ; logger.addHandler(fileHandler1) ; logger.addHandler(fileHandler2) ; logger.getLevel()...

Ant Build.xml to compile java code with external jars

<? xml version= "1.0" encoding= "UTF-8" ?> <project name= "OnlineProductManagement" basedir= "/Users/mohan/IdeaProjects/Java/" default= "build" > <property name= "src" location= "src/main/java" /> <property name= "webapp" location= "webapp/ROOT/webINF" /> <property name= "ext-jar" location= "jars" /> <property name= "dest" location= "${webapp}/classes" /> <property name= "jar" location= "${webapp}/jar/" /> <path id= "build.classpath" > <fileset dir= "${ext-jar}" > <include name= "*.jar" /> </fileset> </path> <target name= "clean" > <delete dir= "webapp" /> </target> <target name= "compile" depends= "...