diplay multipart in jsp
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   vikram_chhetry
Posted On:   Monday, June 26, 2006 03:02 AM

how do i display multipart object in jsp? I m developing an email client and i m unable to display mails with attachments. This is my code in jsp:- for (int j = 0; j < multipart.getCount(); j++){ Part part = multipart.getBodyPart(j); String sct = part.getContentType(); if (sct == null) { out.println("invalid part"); return; } ContentType ct = new ContentType(sct); response.setContentType(ct.getBaseType()); InputStream is = part.getInputStream(); int i; while ((i = is.read()) != -1) out.write(i); } out.flush(   More>>

how do i display multipart object in jsp?

I m developing an email client and i m unable to display mails with attachments.

This is my code in jsp:-

			

for (int j = 0; j < multipart.getCount(); j++){

Part part = multipart.getBodyPart(j);

String sct = part.getContentType();

if (sct == null) {

out.println("invalid part");

return;

}

ContentType ct = new ContentType(sct);


response.setContentType(ct.getBaseType());

InputStream is = part.getInputStream();

int i;

while ((i = is.read()) != -1)

out.write(i);

}

out.flush();

out.close();




But it is not working for me. Please help.    <<Less
About | Sitemap | Contact