Where is it better to use logic with conditions in JSP or Java (backend)?

I have 10 different jsp, each one has a similar tag <div class="content"/>

Different style. Each jsp has a shortcut, 3 buttons and a couple of forms. I want to know if the tag should show <div class="content"/>

or does not depend on 2 buttons and 1 form, if they fill out I need to show CONTENT. The question is where is it better to create validation conditions, in each jsp using JSTL or in a Java method, and in each jsp this method is called?

PS I am using Slice Framework

+3


source to share


2 answers


It is always advisable not to write any logic in the view layer according to the MVC (Model View Controller) framework. So, in this scenario, JAVA is preferred over writing logic in JSP.



It's a standard not to write logic in JSP, but if you are using JSTL and not scriptlets for the logic, that's okay too.

+3


source


It is always recommended to use only the Presentation layer (HTML, JSP only, etc.) for client validation, displaying content from the model level, getting user inputs and displaying outputs.

It is recommended to combine business logic on the java side. So in your case will continue working with the Java part



+1


source







All Articles