JSP must go, or tools must get better
OK, perhaps I'm missing something but this is driving me nuts. When I was building the really simple pages of my app (just a few fields and a couple of buttons) I did not mind the JSP way to build my component tree. But now that I've moved on to the big page that has 40 or so fields and several buttons (yes it messy but that is what the customer wanted) I've decided (again) that I don't like JSP's (or rather I don't like that I can't get tool support to help me spell better). Since I can barely spell my own name many of the attributes were misspelled so I had to build, deploy click through several pages then discover that I misspelled another attribute (grr!). Yes I know I should spell better but where is some compiler support. I have become much worse at spelling (esp method names) since I got completion.
So what I'd really like is a JSP editor that understands the EL and will do completion for me. Anyone found such a thing?
I suppose I could be more careful at spelling but its one of those things that I've decided is superfluous with code completion.


I agree....
Seems like despite developers moving from jsp scripts to JSTL / Struts based pages; there is still a lot of "logic" in jsp pages (which is crazy to debug from most editors; though I hear Eclipse and JBuilder have plugins to support intellisense for jsp?) .
I haven't done any work on this; but does it make sense to write "presentation" servlets instead? Those have been bad because of embedded html; but would better use of string classes and resource files help that?
Just some thoughts
Posted by Greg Akins on January 06, 2005 at 10:36 AM MST #
I'm not sure you'll find much in the way of tools that grok the JSTL/JSP EL, but I seem to recall NetBeans having pretty decent JSP/taglib support. Should help with stuff like misspelled attribute names.
Posted by Kris Schneider on January 06, 2005 at 11:36 AM MST #
Hi Greg,
Thanks for the comment. Presentation servlets would be great. However some of the same issues would come up because you still want the components to have 'method bindings'. So you'd still need some sort of tooling around the EL.
Posted by Bill Dudney on January 06, 2005 at 11:36 AM MST #
Bill, I guess the EL support of JSPs is a good idea but that would be a temporary solution until JSP2.1+ which allows you to create your own EL. In such cases, you good to develop your own EL support for JSP editors. Why are things going towards a complex solution? Why cannot you use the good old myBean.getProperty() java notation in JSP Scriptlet based expressions? I am not saying that you should start putting loops and logic in scriptlets - just use the Scriptlet based expressions. First of all the bean notation is flawed and goes against the law of demeter. Have you ever seen the messages and exceptions thrown by a piece of $#!T framwork know as Struts when bar is null in the bean expression foo.bar.blah? Check out the link below for JSP2.1 EL support.
Posted by Chakra Yadavalli on January 06, 2005 at 07:26 PM MST #
Try MyEclipse (www.myeclipseide.com), it's a set of plugins for Eclipse. The JSP editor has a very nice completion feature.
Posted by Daniel Serodio on January 07, 2005 at 07:54 AM MST #
Hi Bill,
M7 have a product that does code completion etc not only for the tag libs of JSPs, it also does Struts completion as well. I'd ask them about JSTL stuff as well. See http://www.m7.com .
Posted by dion gillard on January 07, 2005 at 05:14 PM MST #
Hi Bill,
In you Pitfall's book in chapter 8, you are showing example of using expression language
for un-hard coded strings:
<jsp:useBean id=?constants?
class=?com.aboutobjects.pitfalls.Constants?/>
<head>
<title><bean:message key=?${constants.browserTitleKey}?/></title>
</head>
<body bgcolor=?white?>
<h1><bean:message key=?${constants.modifyInvoiceHeadingKey}?/></h1>
If is possible to do only with JSP 2.0.
could the similar thing be done with JSP 1.2 ?
Thanks
Posted by Elena Neroslavskaya on January 26, 2005 at 02:23 PM MST #