Archive for the 'Java' Category

How to generate PDF from XHTML or XML source using a Java Applet

Here is an example on how to use a Java Applet to generate a PDF from XHTML or XML source. The main advantage of using an Applet to generate from XHTML or XML source is XHTML/XML source can be gzip compressed from the source web server which reduces very much its size to be transferred over a slow network connection and is speedier, while compared to an actual PDF file that’s transferred over the same network.

Continue reading ‘How to generate PDF from XHTML or XML source using a Java Applet’

Convert documents into flash, a web-viewable format

One of my projects is studying on how to convert any documents in Word, Excel or Powerpoint formats into FLASH format which is viewable by most browsers with flash plugin.

Continue reading ‘Convert documents into flash, a web-viewable format’

A simple Java FTP connection + file download and upload

The Java or JDK comes with NO support of any official API for FTP connection. But there is an internal that comes in the sun.net package, but this is NOT well-documented, and you will hardly find how to use other methods within the sun.net.ftp.FtpClient class.

Continue reading ‘A simple Java FTP connection + file download and upload’

Handling ajax upload the Java way : Using Java server faces and servlet

Looking for way how to program a file upload in the AJAX manner? Here you go, using JavaServer faces, with those cool taglibs, which you get a progress bar and the a file chooser. And the file is being uploaded in AJAX mode. You’ll be shown a progress bar of the uploading status.

Continue reading ‘Handling ajax upload the Java way : Using Java server faces and servlet’

Spring WebFlow 2.0 now includes JavaScript module

Many of you might have known Spring as a J2EE framework that simplifies J2EE development by introducing the MVC (Model View Control) development methodology in J2EE.

Continue reading ‘Spring WebFlow 2.0 now includes JavaScript module’

Method Overloading is possible in JavaScript!

In a full-fledged Object Oriented Programming language such as Java, method overloading is the technique that you could use to create few functions or methods that having the same names but taking different arguments or parameters. Such as follows, the method findUser(), findUser(String), findUser(String, String) in Java.

public class Users
{
   public Collection findUser()
   {
      // the findUser() is a method that returns
      // all users in a java.util.Collection object

   }

   public Collection findUser(String name)
   {
      // the findUser(String) is a method that returns the users matched
      // by the specified name,
      // result returned in a java.util.Collection object

   }

   public Collection findUser(String firstMame, String lastName)
   {
      // the findUser(String,String) is a method that
      // returns the users matched by the specified
      // first and last name, results returned in a java.util.Collection object

   }
}

Continue reading ‘Method Overloading is possible in JavaScript!’

Prototype – a fantastic JavaScript Framework, simplifies Ajax coding

Prototype - a fantastic JavaScript Framework, simplifies Ajax codingWhat is Prototype? Prototype is a JavaScript framework that simplifies AJAX coding and extends the DOM structure. Prototype comes with several short-cut coding methods and modules to allow you to shorten your AJAX coding and it’s browser-safe. Prototype is now available with the latest version, 1.6 for download.

To start using Prototype in your web apps, it’s easy, just download the prototype.js file and include it in any JavaScript tag pairs shown as follows then you can start using the simplified coding in AJAX offered by Prototype.

<script src=”prototype.js” type=”text/javascript”></script>

Continue reading ‘Prototype – a fantastic JavaScript Framework, simplifies Ajax coding’