Hi all, I got a little question about how to show the html like pages in the servlet.I can only use ServletOutputStream out = res.getOutputStream(); to print sth on the brower,but it's can only show the string on the brower,not the table or even buttons. Can we do this without JSP files?
You can use a PrintWriter to send Strings to the browser, but if that Strings are html text, you can send tables, buttons or whatever html element. Here is a sample:
Of course you can also use the Dispatcher to forward the request/response to a jsp and delegate the view to a "view component". Search for Model 2. HTH
You could also use one of the template based schemes where the servlet reads in a HTML formatted file that has special markers to show where the servlet is supposed to insert data. Bill