wait message in JAVA EE

1

I am developing my first web application with Java and I have a little doubt. I have my jsp file where I have my main page, my css and a servlet with which I perform the operations I need. Well, this servlet generates a file that it then returns to the user to download and I would like a waiting message to be shown while it is being generated. Something gif that is going to go around in the meantime, since the option to create a progress bar I see more complicated. Thanks in advance!

    
asked by Miguel Negro 12.06.2017 в 22:40
source

1 answer

0

One way to add a simple upload element to the page is a gif image. you could use jQuery to show the gif and when the content is ready to hide it.

In your ccs add the following which is the url of the gif that you will use:

.loadinggif {
    background:url('http://www.hsi.com.hk/HSI-Net/pages/images/en/share/ajax-loader.gif') no-repeat right center;
}

And in jsp:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input id='inputsource' />
<br>
<button onclick="$('#inputsource').addClass('loadinggif');">Show Loading</button>
<br>
<button onclick="$('#inputsource').removeClass('loadinggif');">Hide Loading</button>

Example Here

    
answered by 13.06.2017 / 00:35
source