Re: JSP still relevant
On Fri, 26 Jun 2009, Lew wrote:
Tom Anderson wrote:
The problem is not java in JSPs, it's logic in JSPs. If you factored the
above code out into a custom tag, or a bean or something, where it could
be written in java and then cleanly integrated with JSP, i think that
would be ideal. But as long as the advice is "don't use scriptlets",
rather than "don't put logic in JSPs", that's not what people are going to
do.
Arved Sandstrom wrote:
Nicely put - I agree 100%.
Although I deal with JSF and Facelets those pages are susceptible to the
same problems. I keep my <c:if>...</c:if> logic confined to deciding what
sections of XHTML to show, based on role, that kind of thing.
Actually, I do see that advice phrased as "don't put business logic in
JSPs, only view logic" from a lot of sources. That is, of course, the
intent behind the less rigorously-phrased form.
But even that is wrong (IMNERHO) - in the example i give, and the
nightmare system i work with, the logic in question is all view logic.
Unless the promulgators of this advice think that the choice of which
message to display in that example is business logic? The writing of view
logic in JSP is something that i don't see warnings against - indeed, i
see a whole industry and community that's built around the idea that
programming with tags is a legitimate thing to do.
tom
--
natural disasters, unexplained phenomena, chaos, chance, tattooing,