provides.  Some logic does belong in JSP.  However, the logic that
appears within pages should be limited to display logic.  I've found
that Struts and JSTL are a great combination to accomplish such
separation.

IMHO this is basically the essence of "Java code does no belong in well designed JSP pages"

Keep the MVC separation in order not to clutter your view (e.g. JSP) with business logic. That can be achieved with various frameworks like Struts. Whenever you "need" code, think of Struts Taglibs or JSTL first. Usually this is sufficient for all the "legal code" in JSPs.
That is "display logic" like reformating values for displayment that were calculated in your business logic elsewhere. E.g. iteration over lists, colorize things, whatever. This will reduce your JSP's Java code to "snippets" of just a few lines. Of course, with custom taglibs even that could be reduced to zero, but that's usually not worth the effort (if not reusable).


Or don't use JSP at all (but if so, bundle with Struts)... Tapestry is also good to separate view and business logic, at least if you don't put to much OGNL in your html templates ;-) That's as worse as too much Java code and EL in JSPs.

Cheers,
Michael


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to