Yap it's possible.First of all ypu just do a .csv file and store it. Then write your code response.setContentType("text/csv"); response.setHeader("Content-Disposition","filename=\"test.csv\""); like this in your jsp page....
Why would you want to avoid 3rd party libraries? Face it, no Java web app of any size is getting done without using a number of other libraries these days.
There's a library called Flying saucer that can convert XHTML + CSS to PDF. So if you generate the HTML page, you could capture the output and generate a PDF from it, assuming that you're generating valid XHTML and are styling the page with CSS (which you should be doing anyway).
A servlet filter that taps into the OutputStream (obtainable from the HttpServletResponse object) would be a good place to put this code. [ July 09, 2008: Message edited by: Ulf Dittmer ]