Your problem is quite more general than JSP/tags/CGI/etc. - how do you teach a
programmer things like good style and code/design/structure esthetics? It is
incredibly hard, especially when dealing with "just get it working" type of
people. The main benefit from tag libraries and the MVC approach in JSP comes
from the separation of concerns (business logic and UI) which leads to an easier
separation of work among hard core developers and UI/scripting people. Ideally,
people doing the UI shouldn't need to know Java. However, in your case you
probably have the same person assuming all the different roles of business logic
developer, UI developer and WEB designer. So for him/her, that argument is
probably invalid. That's why you will simply have to make them realize that code
is plain ugly. And ugly code is the hardest to read and maintain. Besides the
above mentionned advantage of tag libraries, they are better for example also for
the following reasons:

- they provide a clean and powerful means of abstraction that applies well within
the domain of WEB development
- being XML-based, their syntax fits well with the rest of technologies used in
the WEB. And this is no minor point - syntax in any sort of programming construct
has a huge impact on readability, maintainability, ease of use, learning curve
for newbies etc....
- when well written, tag libraries can provide a kind of mini-declarative
language with powerful, targetted semantics
- at the end, they make code much shorter. They make it possible to say more
concisely and clearly what you want at that particular place of your page, in a
declarative way...

So, even when you are looking at a JSP page purely from a programmer's point of
view, and if you have been thaught a thing or two about programming, the benefits
of building and using tag libraries should be more or less obvious.

As for your "another note", it depends how your whole application is
structured....a JSP is a servlet after all so if your particular JSP, which has
only Java code in it,  is acting as a "controller" in the model 2 architecture,
then yes it's still model 2 ;)

Cheers,
Boris

Michael wrote:

> long before server pages or servlets existed i was
> writing these C++ template based systems with CGI
> so i could do my best to separate content generation from programming
> logic...
>
> i'm a consultant and this company made me lead on my first JSP/Servlet based
> project,
> i was really excited to get involved with JSP tag libraries.
>
> but when i got into the code base IT'S ALL .jsp files with
> TONS of Java scriptlets!  it's nasty.  if/else blocks several hundred lines
> long.
> the developer i took this over from
> thinks there is no reason to do it any other way.  tags?  why use tags?
>
> i am asking for input/references on why you want to keep the scriptlets <%>
> </%>
> out of the JSP files.  every time i try to make a point-- maybe
> i'm just not being eloquent enough...
>
> on another note: is it really model 2 if a JSP is processing the request?
> i don't think it is, even if your entire JSP is just some java code
> wrapped with a scriptlet tag..  (yuk).
>
> thanks for input.
> --Michael
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


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

Reply via email to