1

I'm Spring newbie, so sorry if the question is silly. I have Spring MVC form, and 2 methods in an annotation based controller.

@RequestMapping(method = RequestMethod.GET)
public String getUploadForm(Model model) {
    model.addAttribute(new UploadItem());
    initModel(model);
    return "upload/uploadForm";
}

@RequestMapping(method = RequestMethod.POST)
public String create(UploadItem uploadItem, BindingResult result, Model model) throws IOException, ServletException {
    // Some type of file processing...
}

My buissiness requirement is to add "the task is being processed" page cause the processing takes few minutes, so the user should be informed, that task is in progress (but no progress bar is required) just simple massege: "Please wait or something"

Is there any easy method to do that in Spring?

3 Answers 3

3

I think that what you are after is not exactly spring related. If you want to display some message while a longer task is running, you will need to use Ajax/JQuery to display some text/animation while your longer task is executing. I would recommend you take a look at this example to see how you can do such a thing with JQuery.

Sign up to request clarification or add additional context in comments.

Comments

1

I would also suggest you to handle this at client side. One of the best way to do this is you can call server using jquery ajax, which allow you to write your own method to execute until response come-back.

Comments

0

thx guys, I was thinking about running some threads in the background and then redirecting the control on the server side, but indeed client solution is much better and simpler.

I'm going to show the message using jquery/js and submit the form, not even ajax required.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.