Showing posts with label JAVA. Show all posts
Showing posts with label JAVA. Show all posts

July 31, 2004

Working on WORF

I am working on my fifth book on DB2 and .NET with Whei Chen. I sent following stuff for review -

First section- 1.1 explains WORF and how to create WORF service on Apache Tomcat Server whereas second part-1.2 explains how to consume that service in .NET client. First part is related to JAVA environment but not uses JAVA code any where whereas second part is related to .NET.

May 07, 2003

Download an attachment/application using JSP.

Here is code to download an attachment/application using JSP.

<%@ page import="java.util.*,java.io.*"%>
<%
// Read the file name.
File f = new File ("c:/fop/mypdf/" + request.getParameter("file") );

//set the content type(can be excel/word/powerpoint etc..)
response.setContentType ("application/pdf");

//set the header and also the Name by which user will be prompted to save
response.setHeader ("Content-Disposition", "attachment;
filename=\"policy.pdf\"");

//get the file name
String name = f.getName().substring(f.getName().lastIndexOf("/") + 1,f.getName().length());

//Open an input stream to the file and post the file contents thru the
//servlet output stream to the client m/c

InputStream in = new FileInputStream(f);
ServletOutputStream outs = response.getOutputStream();

int bit = 256;
int i = 0;


try {


while ((bit) >= 0) {
bit = in.read();
outs.write(bit);
}


} catch (IOException ioe) {
ioe.printStackTrace(System.out);
}
outs.flush();
outs.close();
in.close();
%>

December 11, 2002

Enterprise Interoperability .NET and J2EE

MSDN article on Enterprise Interoperability: .NET and J2EE

December 17, 2001

JAVA Mail Design

Two cool articles on JAVA mail design -

  1. J.A.V.A. Mail Reader Design Document
  2. Design and Implementation of a Web-based Email System

November 17, 2001

XML document processing in Java using XPath and XSLT

XML document processing in Java using XPath and XSLT

April 02, 2001

Inside DCOM

This grand article discusses the use of ATL (Active Template Library) to assist in building COM components in C++ and other COM issues from the perspective of Visual Basic, Visual J++, Java, and JavaBeans.

March 27, 2001

JAVA examples by API

Cool site on JAVA examples by API

March 17, 2001

Learning the Java programming

Learning the Java programming - articles, samples and lots of info

Here is one more good one..