Download Excel Using Spring Mvc Session

Generate Excel Using Spring MVC In this tutorial we are going to learn how to generate Excel File Using Spring Framework + POI library. Article covers Spring application configuration, custom view definition and configuration which is required for Excel file generation. In Spring MVC application, to download a resource such as a file to the browser, you need to do the following in your controller. Use the void return type for your request-handling method and add HttpServletResponse as an argument to the method. Spring MVC download file example January 27, 2017 Spring-MVC No Comments Java Developer Zone This is example of download file using streaming with spring framework. On the Spring side, we cover two approaches to build the CSV file download functionality: Handling CSV generation and download in a separate controller class. This is the simplest and quickest way. The technique employed is similar to the one described in the tutorial: Spring MVC sample application for downloading files. The difference is that.

Active3 years, 3 months ago

I am using Spring to create and download Excel sheet I want to add some variable in model in requestiong mapping method so that I can use in other request maping method

Mvc Session Data

As you can see in above

I want to use this model value in my other requestMapping method

how can I use CountAndValueExcel model object that is set by first method in second method with using session? Can I send model object(which contains list of class object) back from view to controller?

Ilya Chumakov

Login Application Using Spring Mvc

12.5k4 gold badges48 silver badges87 bronze badges
ExcelKunal BatraKunal Batra
3192 gold badges6 silver badges26 bronze badges

1 Answer

You can save an object into a session:

And then you retrieve it like this:

Wrote it from my head, not tested.

localhostlocalhost
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Not the answer you're looking for? Browse other questions tagged spring-mvcmodel-view-controller or ask your own question.