Some suggestion: When you write to System.out you can see the contents. But when you write the same contents to JSP's printwriter you are seeing wrong contents. Does the contents contain any html tag or xml tag or anything to infer that it is a tag?
If yes then your browser is fooling you. This will probably the case because your source remains same but target differs.
If you can, try eliminating or encoding tags in contents. [ February 14, 2006: Message edited by: jiju ka ]
Whatever you say buddy! And I believe this tiny ad too: