Java & JavaEE5

Tutor

Java shrinker, optimizer, obfuscator, and preverifier Encrypt jar files

http://proguard.sourceforge.net/ Some uses of ProGuard are: Creating more compact code, for smaller code archives, faster transfer across networks, faster loading, and smaller memory footprints. Making programs and libraries harder to reverse-engineer. Listing dead code, so it can be removed from the source code. Retargeting and preverifying existing class files for Java 6, to take full […]

session handaling with Servlet

Use URL rewrite to save session data import java.io.IOException; import java.io.PrintWriter; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class ShoppingCartViewerRewrite extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType(“text/html”); PrintWriter out = res.getWriter(); out.println(“<HEAD><TITLE>Current Shopping Cart Items</TITLE></HEAD>”); out.println(“<BODY>”); // Get the current session ID, […]

Java Compress data communication Object To BytesArray

http://www.unix.org.ua/orelly/java-ent/servlet/ch10_01.htm http://www.unix.org.ua/orelly/java-ent/servlet/ch10_02.htm http://www.oracle.com/technology/sample_code/tech/java/servlets/htdocs/basic.htm import java.io.*; import java.util.zip.*; public class CompressUtils { public CompressUtils() { } public static byte[] compressObjectToBytesArray(Object obj) throws IOException { byte abyte0[] = null; ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream(); ObjectOutputStream objectoutputstream = new ObjectOutputStream(bytearrayoutputstream); objectoutputstream.writeObject(obj); objectoutputstream.close(); Deflater deflater = new Deflater(9); byte abyte1[] = bytearrayoutputstream.toByteArray(); deflater.setInput(abyte1); deflater.finish(); byte abyte2[] = new byte[abyte1.length]; […]

Java Jnlp how to

http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/examples.html http://java.sun.com/developer/technicalArticles/Programming/jnlp/ http://java.sun.com/products/javawebstart/1.2/docs/developersguide.html * Introduction * Using a BasicService Service * Using a ClipboardService Service * Using a DownloadService Service * Using a FileOpenService Service * Using a FileSaveService Service * Using a PrintService Service * Using a PersistenceService Service * Using FileContents * Using a JNLPRandomAccessFile * Using a SingleInstanceService Service * Using a […]