This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes If there is output in Class file then how can i take this out put on Browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "If there is output in Class file then how can i take this out put on Browser" Watch "If there is output in Class file then how can i take this out put on Browser" New topic
Author

If there is output in Class file then how can i take this out put on Browser

avinash maurya
Greenhorn

Joined: Jan 22, 2006
Posts: 2
Hi friends
I have problem that,
If there is output in a class file then how can we take this output on the
web browser.
Please ive answer as soon as possible it is so urgent.
Thanks
Avi
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

what sort of output are we talking about? More information please.
avinash maurya
Greenhorn

Joined: Jan 22, 2006
Posts: 2
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....
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: If there is output in Class file then how can i take this out put on Browser