Ankur Singhal
Ankur Singhal

Reputation: 26077

Dynamic Jsp pages - Taking too long

I have a project which gives the user interface to create the Dynamic forms on the fly. User can select different fields like textbox, textarea, date etc and create a model for the same.

Once the user chooses the component and creates a form, then we need to show that form at a specifies place. The form components are rendered through common jsp page which accepts pojo object and then distributes that object to our own custom created tags for input,checkbox,radio,date etc.

Issue is it takes very 10-15 seconds to render the form.

Is there a way i can create templates or say html code of created forms and store them in DB and render through them. (Provided i am able to still bind data using Spring MVC, show dropdown values, selected or saved data in the fields.)

Upvotes: 0

Views: 1038

Answers (2)

Ankur Singhal
Ankur Singhal

Reputation: 26077

Better way is to create you own custom tags and remove repeated code. This will decrease the compilation time and further decreases the loading time of the page.

Upvotes: 0

Richard Kennard
Richard Kennard

Reputation: 1325

You may want to take a look at Metawidget. It renders different forms inside a common JSP as you describe, and does not have the 10-15 second issue you are seeing.

Metawidget is Open Source, so you can examine how it works, or even use it 'as is' (it is designed to be embedded inside projects such as yours). There's a good example tutorial here: http://metawidget.org/doc/reference/en/html/ch01s03.html#section-introduction-part2-web

Upvotes: 1

Related Questions