Sending huge data to client browser

Wednesday, 20 June 2007, 0:56 | Category : Internet, J2EE, Java, Technology
Tags :

If you want to pass huge data to the client from your servlet, user may need to wait till the ServletOutputStream or JSPWriter flushes the data. This happens generally whenever you have a number of items page and you want to pass it to the client. The better approach is to flush the data partly […]

Using WorkManager in JBoss

Friday, 27 April 2007, 23:00 | Category : J2EE, Java, Technology
Tags :

You can schedule any work (thread that needs to be run) in Jboss using WorkManager API (JCA). Below is a sample code that can be called from any ejb/servlet/mdb or any server side application running in jboss container.

Reading Mails from secure exchange server in Java

Thursday, 26 April 2007, 16:46 | Category : Internet, J2EE, Java, Technology
Tags : , ,

1. Export the certificate for the exchange server from Internet explorer Certificate export wizard e.g. after opening, (View certificate >Details > Copy to File). Say the exported file name is certificate.cer 2. Create keystore from the certificate using java keytool (which will create keystore file in current directory). It will ask for a password, […]

Export File name in servlet/jsp

Thursday, 26 April 2007, 13:49 | Category : Internet, J2EE, Java, Technology
Tags :

While giving a link for export as a file, you may also want to give it a name that should come in save-as dialog or browser. To do so, you have to just set Content-Disposition header and content type of response e.g. for saving as an excel file, following can be used:

Debugging problems related to the JDBC API

Thursday, 26 April 2007, 0:57 | Category : Database, J2EE, Java, Technology
Tags :

A good way to find out what JDBC calls are doing is to enable JDBC tracing. The JDBC trace contains a detailed listing of the activity occurring in the system that is related to JDBC operations. If you use the DriverManager facility to establish your database connection, you use the DriverManager.setLogWriter method to enable tracing […]

Sample java code to read mails from your gmail account

Monday, 23 April 2007, 23:13 | Category : Internet, J2EE, Java, Technology
Tags : ,

Sample java code to read mails from your gmail account