The Source for Java Technology Collaboration
User: Password:



Joshua Marinacci

Joshua Marinacci's Blog

I have seen the light.

Posted by joshy on October 02, 2003 at 01:50 PM | Comments (9)

As part of a new project for work I have finally broken down and learned Struts and JSPs. Struts is tremendously useful. I wish it had been around five years ago when I was up to my ears in webbased applications. But JSPs I've never been impressed with. They are good for templating but the combination of java code and html always seemed crufty. I've been minimizing the amount of code I put in them and certainly prefer to use something like XSL to keep the UI and code separate.

Things are going fine and well, except that now I have a new problem. I want to set up a hosting environment for some friends and family. My sister has a weblog which I wrote as a JSP. I've tried to minimize the amount of java code in it, but it's still brittle. She can code the HTML around it but every now and then her editor breaks it. If she codes by hand then she's even more likely to damage something, and either way she certainly can't modify it with new options. She simply doesn't understand Java code, and honestly there's no reason for her to do so.

But now I've discovered custom taglibs. These are brilliant! From my sister's point of view there are now a few magic tags she can use to do something. My scripts are no longer code, just extensions to HTML, as if there was a new version of Netscape with support for a magic <blog> tag. (i remember long ago when we were eager to update our browsers and get us crazy-cool new tags instead of being frustrated at the lack proper support for the existing tags. ahh, those were the days. :).

I think this teaches us a good lesson. Presentation of technology is just as important as it's implementation. To a programmer there is no difference between:

<% Blog blog = Blog.getBlog("rachel");
  for(int i=0; i<blog.getNumEntries(); i++) {
  %>
  this is my <%=entry%>
  <%
  }
%>

and

 <blog name="rachel">
    this is my <entry/>
 </blog>

But to a novice computer user who just knows HTML there is a world of difference. With a simple tag lib I have hidden all details about iteration, data access and authentication. Now that's some serious power.

This realization has led me on a quest to find more taglibs that fit a hosting mentality. They are hard to find. Most taglibs are still designed for programmers. Helpers for coding frameworks. Very few are end user oriented. And the few that I've found haven't been so great. Even with such a simple user interface it's hard to find tags that are genuinely easy to use. It takes a lot of work to design usable software, even if it's small, and many times it's easy to create the quick solution and move on to something else. Maybe that's why most tags are still for developers.

My challenge this weekend was to find a tree tag. Something that would generate a DHTML tree with as little work as possible. I was surprised to see how many trees would not even let you specify the tree data from within the webpage. One had three separate files. One for the javascript, one for the style configuration, and one for the data configuration. Great for an advanced webdesigner but not so good for the hosted user. Even some of the taglib based tree scripts did not have optimal user interfaces.

Fortunately we live in the great world of opensource where if you don't like something you can make it better instead of complaining. I downloaded one version, rewrote the tag classes, added some jar packaging, stir in one ant build file: and voila you get treetag now available at code.joshy.org. It needs more cleanup but it functions, and the UI (API) is very simple. Go check it out.

I only have one question now. To make these tags truely hosting-safe (ie, drop in a magic tag and it just simply works) I want a way to make the tags already be preloaded into the default namespace. Then my users won't have to declare the taglib at the top of the page or use namespace prefixes.

I would like to thank Guy Davis for the original tags which I based mine on.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • I have [not] seen the light [yet]
    Sorry. There as been an awful mistake. The end of the tunnel is still about ten miles away. Our apologies for any inconveniences.

    Struts is the stone age of web development.

    Get over it.

    You may want to try something more sophisticated or simpler.

    Posted by: zoe_info on October 03, 2003 at 02:13 AM

  • I have [not] seen the light [yet]
    Saying things like this without backing up the reasons why makes you sound dumb. You may be right, but I'd love to hear why.

    Posted by: ensonik on October 03, 2003 at 06:55 AM

  • more than just a Tree
    You can find a lot of tags (including Tree) in Coldtags suite here: http://www.servletsuite.com/jsp.htm

    Posted by: dnamiot on October 03, 2003 at 07:34 AM

  • more than just a Tree
    I looked through those and got some great ideas, but unfortunately they are not opensource. I was surprised to see a lack of really *any* opensource tags that are not related to infrastructure.

    Posted by: joshy on October 03, 2003 at 09:17 AM

  • I have [not] seen the light [yet]
    > makes you sound dumb

    Never pretended otherwise.

    > but I'd love to hear why

    Sorry. Neither the time, nor the place to elaborate. But check the links to get started.

    Posted by: zoe_info on October 03, 2003 at 09:24 AM

  • Re: I have [not] seen the light [yet]
    These are pretty strong words. I'd like to hear more reasons why. Struts is a pretty well designed framework. It is not a toolkit, however. It doesn't actually do that much for you. It's a framework. Mainly it sets up a structure, a certain way of doing things. This means the software produced is more orderly, less buggy, and much easier to maintin.

    Looking at Tapestry it seems to be similar to Struts but with more of a toolkit thrown in as well. One of the reasons I really like Struts is that it tells you where to put things and makes code to page mapping easy but it still lets you hack around with things. You aren't locked into doing things one certain way. You can still do normal links, use something besides JSPs, and pop in code wherever you want. I think it's quite a good balance between design and just being hands off when needed.

    Posted by: joshy on October 03, 2003 at 09:24 AM

  • Re: I have [not] seen the light [yet]
    > These are pretty strong words

    I have been known to push the envelope sometime.

    > Looking at Tapestry

    Look at WebObjects for a more in-depth rational. Tapestry is conceptually based on WOF. To get the executive summary, check Josh Paul's An Introduction to WebObjects.

    > it's quite a good balance

    Your call. Whatever works for you :) I'm not preaching.

    Posted by: zoe_info on October 03, 2003 at 09:38 AM

  • Re: I have [not] seen the light [yet]
    By the way, how does "I have seen the light" sounds? Understated?

    Posted by: zoe_info on October 03, 2003 at 09:59 AM

  • wow power leveling
    wow powerleveling
    wow power leveling
    wow gold
    wow items
    feelingame.com
    wow tips
    Most Valuable WOW Power Leveling Service
    wow power leveling faq
    cheap wow power leveling
    wow power leveling
    wow powerleveling
    wow power lvl

    Posted by: wowleveling3 on December 13, 2007 at 06:14 PM





Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds