Sankalp
Sankalp

Reputation: 173

How to render HTML form fields and run Java code in background simultaneously in JSP

I have made a JSP page that has form fields and java code in scriplets .I have imported the java code in JSP page and made object to call the function of that java class.

When i execute the JSP, the JSP page remains blank and only when all the Java code has been executed then the html form fields are rendered on the view.

I have two questions:

1.)How can i quick this process and how can i show something like "Loading..." until that html is rendered OR 2) How can I make HTML fields to appear as soon as JSP page is invoked while letting all the java code simultaneously running in background.(The java class whose object is made in JSP calls webservices and this may take time, meanwhile i want user should start inputing in the form fields).But user cannot see any form fields until the whole Java code has executed.

KINDLY HELP!

Upvotes: 1

Views: 620

Answers (1)

Alex
Alex

Reputation: 11579

You can display a page first and then to load other content through Ajax.

Upvotes: 1

Related Questions