Java & JavaEE5


Java shrinker, optimizer, obfuscator, and preverifier Encrypt jar files 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; import; import; import; 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 import*; import*; 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 * 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 […]