Capture HTTP/HTTPS traffic from Java programs with Fiddler

12Sep2015 In: Tools

Fiddler is a handy tool which sits between two applications act as a proxy. It includes the ability to view, decrypt HTTP or HTTPS traffic for debugging proposes. For instance, we need capture the all HTTP or HTTPS request/responses from client Java program to the server, and the HTTPS-secured traffic should be decrypted to plain text and displayed in Fiddler.
Download free PDF manuals on
Read the rest of this entry »

Java 7 Applet is Blocked and Warning on Security Permissions

6Apr2014 In: Java applet

After upgrading JRE to Java 7u45, running the Java applet under the default High setting, you may face the below warning message:

This application will be blocked in a future Java security update because the JAR file manifest does not contain the Permissions attribute.

If the version is 7u51, more directly, that unsigned code is set to “Don’t Run” so the applet is blocked:

7u45_example_blocked_dialog Read the rest of this entry »

How to write to a file in Ant

8Nov2013 In: Ant

To write the text message to a file in ant, you can use ant target echo, it provides the way to directly append to an existing file or write to the new file.
Do you want to learn java quickly? There are a lot of pdf books about java. Some of them have huge sizes. Try out our pdf compressor to reduce pdf file sizes.

The below target demostrates how to write the string to a file in ant script

<echo file="myoutput.txt" append="true"/>
   The content to be written to myoutput.txt, the classpath is ${classpath}

If the file myoutput.txt already exists, ant will append the content to this file. If it does not, Ant will create a new one and write the content into it.

Ant – How to print classpath in Ant script

2Nov2013 In: Ant

The below target print_classpath in build xml demonstrates how to print the project classpath in ant script, this gives the ability to check loaded classpath at runtime. Read the rest of this entry »

How to enable ANT verbose?

2Nov2013 In: Ant

The Ant verbose option can give you the information about what Ant is doing. you can turn on the verbose flag to debug the ant script:

How to do? If you use Ant command line, you can execute ant with -verbose flag:

ant -verbose  OR  ant -v Read the rest of this entry »

Thread-safe Hash Map in Java and their performance benchmark

9Oct2013 In: Core Java

1. Java Thread-safe Map Overview

The Map object is an associative containers that store elements, formed by a combination of a uniquely identify key and a mapped value. In Java, the most important Map implementation is HashMap, unfortunately it is not synchronized.

Tips: A map cannot contain duplicate keys, each key can map to at most one value.

What does the thread safe Map means? If multiple threads access a hash map concurrently, and at least one of the threads modifies the map structurally, it must be synchronized externally to avoid an inconsistent view of the contents. (A structural modification is any operation that adds or deletes one or more mappings; merely changing the value associated with a key that an instance already contains is not a structural modification.) Read the rest of this entry »

TCPMon Tutorial – Web Service Debugging Tool

4Oct2013 In: Tools, Web Services
Revision History
Revision 1.0 10.04.2013 Admin TCPMon Tutorial
Revision 1.1 10.05.2013 Admin Add Tips, bug fixes and enhancements

When developing web services applications, it’s often on demand to be able to track the SOAP messages passed along in TCP based conversation, the TCPMon comes as the first option to capture the outgoing and incoming SOAP envelopes.

1. TCPMon Introduction

TCPMon is a open source utility debug tool, distributed under the Apache 2.0 license. It has originally being part of Axis1 and now stands as an independent project. The official web site is It is based on a swing UI and works on almost all platforms that Java supports. It allows user record, monitor and resent the messages, This TCPMon tutorial is step-by-step guide to explain how TCPMon works and also to explain its features.

(There’s a same name TCPMon project in a Google Code, but that’s not the same one, and it only has less features).

Read the rest of this entry »

Ant – how to get current directory in Ant

24Feb2013 In: Ant

how to get current directory in Ant ?

To get the current directory, you can directly use ant build-in property ${basedir}, it  gives us the actual directory where ant is ran from (also the parent directory of the buildfile).

<target name="print-directory">
  <echo>current directory: ${basedir}</echo>

how to get user working directory in Ant ?

To get the user working directory, you can directly use ant build-in property ${user.dir}, it is actually exposed by Java System.getProperties(). so it’s the JVM current working directory. it is for often located C:\Users\user_name.

<target name="print-directory">
  <echo>current directory: ${user.dir}</echo>

How to convert milliseconds to date string in Oracle SQL

24Jan2013 In: Oracle

If you store the date in milliseconds, for instance, 1126483200000, its milliseconds since January 1, 1970, 00:00:00 GMT in Oracle, we can see, even one second converts to thousand milliseconds, its just a huge number which means nothing and hard to read. So usually we have to write Oracle SQL query statement to get this milliseconds and convert to a date string format as instead: Read the rest of this entry »

How to deploy a war file to jetty

18Jan2013 In: Jetty

Like what we often do in tomcat, we can still static or hot deploy war file(packed or unpacked) to Jetty container, this tutorial will demonstrate how to deploy a war file to jetty? Read the rest of this entry »