0

I want to create a jar file which will dynamically create Excel sheet and stream the file contents through the response output stream to the client browser. In server side, generated file should not get saved. We can achieve this using servlet but i need JAR so we cant make use of it. So how can i achieve this? war/servlet file need to be deployed on webserver. Jar need not be. So for this exporting functionality i cant make use of sepereate webserver.

savanthhas
  • 11
  • 3
  • possible duplicate of [JAVA : Exporting Data (from database) to excel and sending it to client side](http://stackoverflow.com/questions/9293311/java-exporting-data-from-database-to-excel-and-sending-it-to-client-side) – OldProgrammer Feb 08 '14 at 16:35
  • 1
    Your data format will not be known to any library provider. Also this is a known problem which has been solved several times. Look at :http://stackoverflow.com/questions/16193970/servlet-export-reponse-to-excel-file – randominstanceOfLivingThing Feb 08 '14 at 16:35
  • I cannot use servlet. Any alternative? – savanthhas Feb 08 '14 at 16:37
  • Look at a Apache POI question @ http://stackoverflow.com/questions/17491527/send-excel-file-to-client-using-java-servlets – randominstanceOfLivingThing Feb 08 '14 at 16:38
  • Edit your question and provide more details of your environment and the problem you are addressing. It is difficult to understand that you can add a jar dependency but not add a Servlet. – randominstanceOfLivingThing Feb 08 '14 at 16:40
  • Its again servlet. If we use servlet it will be war. i need jar. Its like request comes to JAR, JAR dynamically creates sheet and response goes back to browser. – savanthhas Feb 08 '14 at 16:43
  • Why? You want something that responds to a client web browser. So then you need a servlet. Who said you can't use servlets and why did they say that? – Erwin Bolwidt Feb 08 '14 at 16:45
  • This is the requirement. Whether its possible with jar? I have done the same with war/servlet. – savanthhas Feb 08 '14 at 16:49
  • To execute something on the server you send a request. In java applications what servs the request is a servlet. Something have to listen there and know how to manage the request. This is servlet. The jar must resides in your application, servlet call your api and redirects the outputs stream with the excel content (or what else you have). – Thrash Bean Feb 08 '14 at 16:59

0 Answers0