tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Johnson <>
Subject Re: What is it mean that "Java code does not belong in well designed JSP pages"?
Date Sun, 23 Jan 2005 15:56:13 GMT
The intent of JSP is that it is primarily HTML with just enough Java to
make things work.  Ideally, you can hand a JSP to a web designer who is
not a programmer and they can make a pretty web page that works.  In
some shops this works.  As a productivity booster, this works in some
shops.  But in others it is a miserable failure.

With that being said, my _personal_ experience is that programming in
HTML tags is a pain in the <%taglib/>.

I don't have a problem learning another language to do a job - I
regularly use COBOL, Pascal, Java, and SQL in any single project. 
Adding a JSP front end adds JavaScript, a couple of XML namespaces, and
HTML to the mix.

Using taglibs instead of code adds a level of obfuscation that, IMHO, 
makes it difficult to get work done.  I always end up taking the servlet
that was generated from the JSP and rewriting it so it works correctly,
performs adequately, and generates no side effects.

This is a battle that will never be resolved because both sides are
right, depending on the circumstances.

JSP purists will shoot me, but I'll take plain old Java code over HTML
taglibs any day.  Write JSP's in accordance with your shop's standards
and make them work in the time allotted to the task.  Ultimately, your
company pays the bills, so whatever gives your shop the best
productivity is the "right" choice.

On Sun, 2005-01-23 at 09:07, Dola Woolfe wrote:
> I just read this thread and didn't quite understand
> it. If it means what it seems to mean on the surface,
> I'm doing everything wrong.
> Schematically, my typical JSP page looks like the
> following (basically 100% code). Is this what Craig is
> advising against?
> <%@ page errorPage="ErrorPage.jsp" import="html.*"%>
> <%@include file="InitializePage.jsp"%>
> <%
>     Table table = new Table()
>     .pAddH("#").pAddH("Action").pLN()
>     .pAddC("1").pAddL(new Anchor("HelloPage.jsp", "Say
> hello to my friend.")).pLN()
>     .pAddC("2").pAddL(new Anchor("GoodByePage.jsp",
> "Say good bye to my friend")).pLN()
> ;
>     MyTemplate template = new MyTemplate ("Main
> Actions", table);
>     Page pAgE = new Page(new MyHead("Data Tools"), new
> Body(template));
> %>
> <%= pAgE %>
> __________________________________ 
> Do you Yahoo!? 
> Read only the mail you want - Yahoo! Mail SpamGuard. 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message