"How can I maintain the http connection during the time for generating the .xls file?"
Simple answer: you cannot. A least you cannot guarantee that a single simple HTTP GET request (and the underlying TCP connection) work reliably. Depending on the client specifics and the network the client is inside, your users might often experience errors (connection timeouts which your application does not handle).
So, the right question is: which technology do you need to let users get this file, independent of how long it takes to generate and of how bad their Internet connection is?
There are many possible approaches, and all of them have their disadvantages. Depending on which browsers you want to support, there are a couple of options. All of them require client-side JavaScript usage.
You might want to use the modern Server-Sent events, which allows the server to actively trigger an event in the browser, to which the browser can respond as desired.
A more classical approach would be (long) polling over HTTPS, where you do as before, but configure the timeout times in client as well as server to be quite large. Additionally, you need to have JavaScript in place that just repeats the request in case it has timed out. Also, there are dirty techniques established for preventing a timeout.
You might want to have to do some research, using the terms "server push", "comet", "long polling". Doing so, you will probably read about WebSockets (which you do not directly need in my opinion).
I guess if I were you I would now choose to use Server-sent events. But you have to figure this out yourself, depending on your exact requirements.
By a quick glance, the introduction to this article may be a good read: https://jersey.java.net/documentation/latest/sse.html
Also, the introduction of the W3C Server-Sent Events specification is nice. Quote:
Event streams requests can be redirected using HTTP 301 and 307
redirects as with normal HTTP requests. Clients will reconnect if the
connection is closed; a client can be told to stop reconnecting using
the HTTP 204 No Content response code.
Using this API rather than emulating it using XMLHttpRequest or an
iframe allows the user agent to make better use of network resources
in cases where the user agent implementor and the network operator are
able to coordinate in advance. Amongst other benefits, this can result
in significant savings in battery life on portable devices. This is
discussed further in the section below on connectionless push.