what sort of output are we talking about? More information please.
posted 12 years ago
hi first i tell u about my application. in my application i am using one servlet in which doGet method is defined..in that doGet method i called one method of another java Class.. this method(method of java class) receiving some files from the QUEUE.. i want to print the result of every file received...one after another...on the browser......this is an JMS application......how can i send message or string from that program to the browser....
You have two options, 1) you can get the method to return the data as a String to the Servlet and get the servlet to write it to the client or 2) you can pass the PrintWriter or OPutputStream to the second class and get it write its own output to the client.
I tend to prefer option 1, since option 2 may require the second class to know it is outputting HTML data. This tends to confuse the responsibilities of the second class.
If I'd had more time, I would have written a shorter letter. -T.S. Eliot such a short, tiny ad: