0

Using JSF1.2, I have a group of checkboxes on a page that the user will check to specify what data they want returned in a csv file. On clicking the submit button, I want to grab the checkbox values and use those to query a database and only return those values in the csv file. What would the best option be?

Use a commandExButton to call the backing bean and set the values and generate the csv, but then how do I get the response back to the browser?

Use an outputLink to call another servlet that will generate the response, but how do I get the checkbox params to the servlet?

If I use a commandLink to call a servlet, it would use a doPost, but how do I do a navigation rule to not go to a different page?

Many thanks

user1523885
  • 101
  • 1
  • 7
  • See this post - http://stackoverflow.com/questions/14968593/jsf-csv-download-in-bean My output throws a nullPointer. – user1523885 Feb 20 '13 at 16:52
  • Then it's `null`. Make sure that it's not `null`. – BalusC Feb 20 '13 at 16:53
  • I went through the debugger and found that the response is null after I get it from the FacesContext. Why would that be null at that point? I tried to just setContentType("text/csv") and then println the getContentType() and nothing is printed. I thought the response would always exist if taken from the context. @BalusC – user1523885 Feb 20 '13 at 17:54

0 Answers0