<?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/1.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Are scriptlets in JSPs really that bad?</title>
	<link>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad</link>
	<description>Web Development, Classical Music, Kitties, and whatever else I feel like</description>
	<pubDate>Tue, 18 Nov 2008 10:01:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=1.5</generator>

	<item>
		<title>by: Matthom</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad#comment-189</link>
		<pubDate>Tue, 24 Aug 2004 13:06:37 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad#comment-189</guid>
					<description>Half the stuff you mentioned I am hardly familiar with - but I do agree that the mere mention of putting scriplets into the JSP page seems to be a horrible sin.

In all the books and resources I've read regarding JavaServer Pages, they all the same thing, which is &quot;Don't put Java code in the JSP! You might confuse the HTML programmer!&quot;

But, as far as your question goes, I don't think there's anything wrong with doing it. Depends on the situation. I think all the warnings simply mean, &quot;Don't get in the habit of doing it.&quot;

On another thought...

When the size and scope of the project increases, you don't want a bad habit to slow things down.

And then, of course, working with Java and JSP is always mentioned as a &quot;team initiative.&quot; Meaning there is always a large team working on the project, and if one JSP developer is mindlessly inserting Java code into the JSP, then he/she disrupts the &quot;team cycle.&quot; Because, obviously, that is not his/her duty.

I think that's what all the warnings could be for.</description>
		<content:encoded><![CDATA[	<p>Half the stuff you mentioned I am hardly familiar with - but I do agree that the mere mention of putting scriplets into the JSP page seems to be a horrible sin.</p>
	<p>In all the books and resources I&#8217;ve read regarding JavaServer Pages, they all the same thing, which is &#8220;Don&#8217;t put Java code in the JSP! You might confuse the HTML programmer!&#8221;</p>
	<p>But, as far as your question goes, I don&#8217;t think there&#8217;s anything wrong with doing it. Depends on the situation. I think all the warnings simply mean, &#8220;Don&#8217;t get in the habit of doing it.&#8221;</p>
	<p>On another thought&#8230;</p>
	<p>When the size and scope of the project increases, you don&#8217;t want a bad habit to slow things down.</p>
	<p>And then, of course, working with Java and JSP is always mentioned as a &#8220;team initiative.&#8221; Meaning there is always a large team working on the project, and if one JSP developer is mindlessly inserting Java code into the JSP, then he/she disrupts the &#8220;team cycle.&#8221; Because, obviously, that is not his/her duty.</p>
	<p>I think that&#8217;s what all the warnings could be for.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Steve Eady</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad#comment-1333</link>
		<pubDate>Fri, 01 Jul 2005 11:30:22 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad#comment-1333</guid>
					<description>Good article.  I found your site via google when I was searching around on the topic of using static variables in JSP/JSTL.  I happen to work on a project where the HTML developer knows little about programming and scriptlets DO scare him.  Also, scriptlets tend to make my jsps very unreadable compared to the JSPS when i use JSTL/Struts tags.  You mentioned the lack of &quot;as you type&quot; editor support as a reason to like scriptlets.  I haven't used IntelliJ as of yet, but my editor combination of Eclipse + Nitrox JSP editor does very well.  The Nitrox plugin does a lot of nice code completion and as you type checking for validating that your tags &quot;look&quot; correct and adhere to the TLDs.  True there is no type-checking, but that is one of the BENEFITS of EL, not having to cast everything from one type to another.

Another benefit of staying away from scriptlets is because scriptlets don't encourage the developer to design re-usable code.  It takes more time up-front to design a good library of custom tags for your application, but once you do it makes modifying and implementing new features a lot faster.  Also, if you want to change some of the functionality of your custom tags, you only have to do so in 1 place, whereas if you want to change how some re-used scriptlet code works, you have to update each page where it us used.  This is bug-prone in large applications.

I really like the layout of your site Jennifer.  I plan on designing mine in a similar fashion with pictures of my sweeter than honey twin boys and the occasional article on whatever topics come to mind.

Contact me sometime if you want to chat about anything:
aim: eadyjava
Y!: stephene

I will setup a link to your site on mine as soon as I get a chance to work on it some more.</description>
		<content:encoded><![CDATA[	<p>Good article.  I found your site via google when I was searching around on the topic of using static variables in JSP/JSTL.  I happen to work on a project where the HTML developer knows little about programming and scriptlets DO scare him.  Also, scriptlets tend to make my jsps very unreadable compared to the JSPS when i use JSTL/Struts tags.  You mentioned the lack of &#8220;as you type&#8221; editor support as a reason to like scriptlets.  I haven&#8217;t used IntelliJ as of yet, but my editor combination of Eclipse + Nitrox JSP editor does very well.  The Nitrox plugin does a lot of nice code completion and as you type checking for validating that your tags &#8220;look&#8221; correct and adhere to the TLDs.  True there is no type-checking, but that is one of the BENEFITS of EL, not having to cast everything from one type to another.</p>
	<p>Another benefit of staying away from scriptlets is because scriptlets don&#8217;t encourage the developer to design re-usable code.  It takes more time up-front to design a good library of custom tags for your application, but once you do it makes modifying and implementing new features a lot faster.  Also, if you want to change some of the functionality of your custom tags, you only have to do so in 1 place, whereas if you want to change how some re-used scriptlet code works, you have to update each page where it us used.  This is bug-prone in large applications.</p>
	<p>I really like the layout of your site Jennifer.  I plan on designing mine in a similar fashion with pictures of my sweeter than honey twin boys and the occasional article on whatever topics come to mind.</p>
	<p>Contact me sometime if you want to chat about anything:<br />
aim: eadyjava<br />
Y!: stephene</p>
	<p>I will setup a link to your site on mine as soon as I get a chance to work on it some more.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jennifer</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad#comment-1334</link>
		<pubDate>Fri, 01 Jul 2005 13:12:38 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad#comment-1334</guid>
					<description>Hi Steve, thanks for stopping by.

Interesting to hear about your project, with the roles.  Do custom tags bother your HTML developer at all, or just scriptlets?

IDEA does code completion for the custom tags themselves, but not for the expression language, which is where I end up making mistakes.

Have you used XSLT at all?  There's a bit of a learning curve, and there are some limitations which can be frustrating, but it's kind of nice once you get used to it - now I find myself wanting to use XSLT constructs in my JSP code!</description>
		<content:encoded><![CDATA[	<p>Hi Steve, thanks for stopping by.</p>
	<p>Interesting to hear about your project, with the roles.  Do custom tags bother your HTML developer at all, or just scriptlets?</p>
	<p>IDEA does code completion for the custom tags themselves, but not for the expression language, which is where I end up making mistakes.</p>
	<p>Have you used XSLT at all?  There&#8217;s a bit of a learning curve, and there are some limitations which can be frustrating, but it&#8217;s kind of nice once you get used to it - now I find myself wanting to use XSLT constructs in my JSP code!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jennifer</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad#comment-1335</link>
		<pubDate>Fri, 01 Jul 2005 13:44:32 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad#comment-1335</guid>
					<description>By the way, I just recently discovered the &lt;a href=&quot;http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/tld-summary.html&quot;&gt;JSTL functions&lt;/a&gt;.  I'm not sure how long they've been around, but they're useful for taking up some of the slack.  Now in your expressions, you can use length() to get the size of collections.  There are also some string functions that might or might not be useful to people.</description>
		<content:encoded><![CDATA[	<p>By the way, I just recently discovered the <a href="http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/fn/tld-summary.html">JSTL functions</a>.  I&#8217;m not sure how long they&#8217;ve been around, but they&#8217;re useful for taking up some of the slack.  Now in your expressions, you can use length() to get the size of collections.  There are also some string functions that might or might not be useful to people.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Steve Eady</title>
		<link>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad#comment-1438</link>
		<pubDate>Mon, 08 Aug 2005 12:33:26 -0700</pubDate>
		<guid>http://jennifergrucza.com/blog/archives/2004/08/17/are-scriptlets-in-jsps-really-that-bad#comment-1438</guid>
					<description>I try to use JSTL in place of struts tag since JSTL is &quot;standard&quot; so to speak.  In fact, the only struts package I ever use is HTML.  The logic and bean packages have JSTL equivalents.  I don't have any experience in XSLT/XHTML as of yet, however I'm on the verge of learning because lately I've been branching out into the world of PHP (like installing and modifying my own WordPress installation).  Some of my experiments in PHP have been with scripts that use the X--- translation.  I look forward to learning more about each.

Professionaly, I'm stuck in the java/struts world for the foreseeable future.  However, I do have a nifty over-ridden architecture because the application I am developing is heavily frame-based, which struts doesn't like too much.  Everything has to go through the session  rather than the request because the order in which the frames render isn't guaranteed.  It's slowly becoming a behemoth and any code tips or tricks that I can read about to make it simpler the better off I'll be.</description>
		<content:encoded><![CDATA[	<p>I try to use JSTL in place of struts tag since JSTL is &#8220;standard&#8221; so to speak.  In fact, the only struts package I ever use is HTML.  The logic and bean packages have JSTL equivalents.  I don&#8217;t have any experience in XSLT/XHTML as of yet, however I&#8217;m on the verge of learning because lately I&#8217;ve been branching out into the world of PHP (like installing and modifying my own WordPress installation).  Some of my experiments in PHP have been with scripts that use the X&#8212; translation.  I look forward to learning more about each.</p>
	<p>Professionaly, I&#8217;m stuck in the java/struts world for the foreseeable future.  However, I do have a nifty over-ridden architecture because the application I am developing is heavily frame-based, which struts doesn&#8217;t like too much.  Everything has to go through the session  rather than the request because the order in which the frames render isn&#8217;t guaranteed.  It&#8217;s slowly becoming a behemoth and any code tips or tricks that I can read about to make it simpler the better off I&#8217;ll be.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>

