Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where will be better use logic with conditions on JSP or Java(backend)?

Tags:

java

jsp

jstl

I have 10 different jsp, each of them have similar tag <div class="content"/> Different only style. Each jsp have Label,3 button, and couple forms. I want know, must show tag <div class="content"/> or not depends of 2 buttons and 1 form, if they are fill, I need show CONTENT. Question where better create checking conditions, in each jsp using JSTL or in Java method, and in each jsp call this method ?

PS I using Slice Framework

like image 950
Vitaliy Avatar asked Nov 18 '25 21:11

Vitaliy


1 Answers

It is always advisable to not write any logic in presentation layer according to MVC(Model View Controller) structure. So, in this scenario JAVA is more preferable than writing logic in JSP.

It is the standard to not write logic in JSP but if you are using JSTL not scriptlets for logic it is also ok.

like image 180
Sagar Rout Avatar answered Nov 21 '25 13:11

Sagar Rout



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!