Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a performance difference between writing java inside jsp?

Is there a performance difference between writing java inside jsp pages by embedding them in html (like php, and asp.net) -and- using controller classes and using the JSP page to render the data?

like image 885
avon_verma Avatar asked May 07 '26 02:05

avon_verma


1 Answers

Both should be equivalent, since everything you wrote in a JSP (scriptlets I mean) is translated into a servlet class, so it will be equivalent. Of course the difference will be in the quality of the generated code and the code you manually wrote.

However, it's not recommended to use scriptlet based JSPs anymore, you should use an MVC approach with scriptletless JSP and servlet controllers.

like image 182
Marcelo Avatar answered May 09 '26 15:05

Marcelo



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!