Thank you for the useful responses. I agree with the person (sorry, tough to both type and look up names...) who said that I wrote enough code for it to be a servlet. In fact, I would rather write a servlet! This is because I prefer to work with JBuilder and JBuilder does an OK job aligning and code completing .java files (about 80% of what Emacs' performance) and an outright lousy working with .jsp pages.
But there are such tremendous barriers to entry with a servlet. You need (or maybe things got better) to modify web.xml and restart the app. Then every time the code changes, the app needs to be restarted. The project I work with takes 2 min to start up so this is prohibitive. Sometimes for development purposes I dumb it down so it takes 10 sec to start up but it is still a pain. Am I saying anything that indicates that I'm doing things wrong? The one thing that I can't imagine being the right thing to do (for me) is writing html code. Just switching 2 rows in a table is enough to send me into a panic. And you don't find out that you made a mistake until you view the page. That's why I use an html library with classes like Table, Page, Body, Form.Button, Anchor, etc. Again any comments? I truly enjoy reading the dicussion that I started. --- Parsons Technical Services <[EMAIL PROTECTED]> wrote: > Don't ask to see my code. All I know is it works.... > most of the time. > > Really, I think it is a matter of circumstance. Each > case is different and > allows for sway from one extreme to the other. > > One word of caution to people just learning, is that > as you move from > company to company expect to see a wide variety of > philosophy about how > something is done. So it is wise to understand each > approach and it's pros > and cons. I work for myself and I am still trying to > understand the approach > here. > > So what you will most likely find is that people > will take the most direct > path that the environment and knowledge will allow. > Of course there are > always the exceptions. > > Dola don't get too tied up in "proper" approaches as > much as understanding > the whys and why not to do it that way. As you code > things you will always > see a different or better way after you are almost > done. > > Doug > > > ----- Original Message ----- > From: "Frank W. Zammetti" <[EMAIL PROTECTED]> > To: "Tomcat Users List" > <[email protected]> > Sent: Sunday, January 23, 2005 1:22 PM > Subject: Re: What is it mean that "Java code does > not belong in well > designed JSP pages"? > > > > That's a good point Tim... I have to admit I've > only used methods a couple > > of times in JSPs, generally preferring all the > code be inline (except > > where there would be a lot of duplication, then I > tend to make utility > > classes). You make a good point though, I may > start getting into that > > habit myself :) > > > > -- > > Frank W. Zammetti > > Founder and Chief Software Architect > > Omnytex Technologies > > http://www.omnytex.com > > > > Tim Funk wrote: > >> Essentially you have written a servlet but > packaged it as a JSP. Anytime > >> it becomes a trivial effort to hand transform a > JSP into a servlet > >> usually means some refactoring is in order. > >> > >> Personally I do not mind java code in JSP's but > only if its structured. I > >> try not to rely on in-line java code - but I try > to use methods or inner > >> classes for most java coding in a JSP. By doing > that - it becomes easier > >> to rip the methods and inner classes from the JPS > page and into an > >> independent object. By doing this - I get rapid > turnaround - but don't > >> code myself in a hole for when new functionality > might be needed that > >> might overlap existing pages. > >> > >> -Tim > >> > >> 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.*"%> > >>> <[EMAIL PROTECTED] 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. > >>> http://promotions.yahoo.com/new_mail > >>> > --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: > [EMAIL PROTECTED] > >>> For additional commands, e-mail: > [EMAIL PROTECTED] > >>> > >>> > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: > [EMAIL PROTECTED] > >> For additional commands, e-mail: > [EMAIL PROTECTED] > >> > >> > >> > >> > >> > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __________________________________ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
