--- Jim Barrows <[EMAIL PROTECTED]> wrote: > > > > -----Original Message----- > > From: Woodchuck [mailto:[EMAIL PROTECTED] > > Sent: Friday, August 27, 2004 10:22 AM > > To: struts > > Subject: philosophical question/poll about Struts/JSTL, scriptlets > > > > > > sorry to bring this up on a Friday... > > > > does everyone here have pure Struts/JSTL jsp pages that is > absolutely > > void of scriptlets? > > Every single one but the main layout page, because I haven't figured > out a better way to use tiles putList. > I avoid them like the plague.... they're almost, imho, as bad as > javascript. Then again I have nightmares about > out.println("<html>")....... > > > > > or do you have jsp pages that use a combination of Struts/JSTL and > > scriptlets, all living together harmoniously using whichever method > is > > easiest/cleanest? > > Depends.. I turn everything over to a html person. The lesss > scriptlets I use the happier she is. > > > > > > is mixing Struts/JSTL with traditional scriptlets a bad thing? > > I thinks so... ymmmv > > > > > i have to say that i would prefer to *not* mix scriptlets with > > Struts/JSTL but in some situations it seems scriptlets is the > better > > solution (in terms of code maintainability). that is, it would be > > easier to use a little snippet of scriptlet here and there instead > of > > making a round-about (albeit clever) and more verbose way of doing > the > > same thing without scriptlets... > > Depends on what you're talking about.. and who you're talking about. > If your code is never going to be seen by anybody but java > programmers,then you may be correct. > > > > > any opinions is welcome! i want to be able to sleep without > > nightmares > > about this!! :) > > Most programmers would probably find that the scriptlets are somewhat > easier...however I also look at tags as method calls, in terms of > encapsulation. I don't need to know what they do, just that they do > it. I don't really care how <html:radio generates a radio html bit, > just that it does so in a manner that makes my life easier, like only > having to know the property name etc. etc. > I have several tags that print lists of things.... change the tag and > I've changed the way the lists are retrieved. That can be harder to > do in a scriptlet. > Using scriptlets, to me is like going back to the bad old days of > out.println("<html");.
if, the move from scriptlets to tags was based on code readibility/maintainability then it seems to me that (in keeping the original intention) the correct way would be to use the simplest solution(s), whether it's scriptlets, Struts tags, or JSTL. you're right, in a sense, tags can be thought of just encapsulated scriptlets or java code. and i wouldn't write a scriptlet to do all the things that <html:radio> does for you. but simple scriptlets like accessing static final variables takes 2 lines using scriptlets. one to declare the class holding the static variables. and another to access it. even from a web/html person's perspective i think this would not be a problem if they see it sprinkled on the jsp source. and although i also like the purist idea, it does seem to break when i know that there is a simpler way to do it if i just slip a little scriptlet in... no, i don't know what i'm going to do yet. it's not a black and white situation, and it probably won't be. it's still grey to me right now.. ...i sense i will be visited by the nightmares tonight.... _______________________________ Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now. http://promotions.yahoo.com/goldrush --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]