-1

I am developing dynamic web application using JSP and servlet. One of the methods is to read CSV file. I have done code for reading contents from CSV file. The contents are printed on console, I want this console's output on the web application's window. How can I do it?

dur
  • 15,689
  • 25
  • 79
  • 125
Dip
  • 57
  • 10

2 Answers2

0

Writing This Code,you can print message in browser.

PrintWriter out = response.getWriter();
out.println("message");
Sanjay
  • 2,481
  • 1
  • 13
  • 28
  • where to write it, Is in servlet where im calling Read method to read csv? – Dip May 19 '17 at 09:01
  • @Dip See how to redirect the stream with [Redirect System.out.println](http://stackoverflow.com/questions/3228427/redirect-system-out-println) to use the `response` writer. This should be done at the beginning to send every `System.out.printxxx` message in the response stream. From there, not sure how to access them yet ;) – AxelH May 19 '17 at 10:44
  • Yes it is in Servlet. – Sanjay May 19 '17 at 11:56
-1

use Table tag in jsp . In th put your header name and in Td print your data using loop <%=Your data%>.

dron
  • 1
  • can you please explain in detail..However I dont want to display it by hardcoding..I want to call that output data from console to browser. – Dip May 19 '17 at 06:55
  • OP want a way to print the value of the output stream into his page. Not some specific instance – AxelH May 19 '17 at 10:42