« JavaLobby bloggers. | Main | JRoller.com. »

Holy grail of Java web development?

As I was working on Roller, I kept the UI fairly simple. I didn't create any forms that needed to refresh themselves before making a final post. I tried to avoid using JavaScript except where absolutely necessary. I was pretty happy with Servlets, JSP, and Struts.

Now, I'm working on a Java-based web application with very complex forms. Some of the forms have multiple tree choosers, dynamic select boxes, popup windows with dual-lists, and popups that cause the page that launched them to reload. There is just no avoiding JavaScript and our requirements are pushing us towards complex solutions like inner-browsing to reduce the number of trips to the server for page reloads.

I can live with JavaScript and I'm taking the time to study up, but I'm becoming pretty disenchanted with web-MVC. I'm finding that, even with an web-MVC framework like Struts, maintaining the state of all of the form fields and UI widgets through page reloads and popup interactions is a real pain. There has to be a better way and, the more more I read about Java Server Faces the more I become convinced that it will be that better way. JSF will introduce UI components that can manage their own state, fire events, and, in general, behave more like true UI components. Sounds like the holy grail of Java web development. Do any of the existing Java web application frameworks support this kind of UI components today?

Comments:

http://barracudamvc.org/Barracuda/index.html haven't used it in anger, so I can't really comment on its shortcomings, but its got a good component model, and if you've used swing at all you'll appreciate its delegation event model.

Posted by Jed Wesley-Smith on October 03, 2003 at 05:25 AM EDT #

IIRC JSF doesn't follow the MVC paradigm - you must specify your UI code in java (uck!). At my current consulting assignment, we have forms where each 'question' is its own object, and has state. I used webwork at the top level to manage the page flow, and then wrote a second webwork dispatcher to dispatch each question to an action. So each 'type' of question has its own action. There are a few small hacks (questions can't delegate to view directly, but must pass back the view pages to the top level dispatcher), but in general it works very very well. To split up the namespace, each question's parameters are prefixed by question_XX{fieldName}. For some questions I even use the command driven pattern by having question_XXCommand=abc will call action!doAbc. We keep the state of the questions in the session (meaning you don't need to post state back to the client each time). So I would recommend looking at Webwork 1.3, and writing your own 'question' dispatcher. Contact me via email if you want some more information. Scott - PS - I couldn't work out how to get paragraph breaks?

Posted by Scott Farquhar on October 03, 2003 at 06:38 AM EDT #

If you're looking for alternatives, you may want to take a look at Tapestry (it has UI components) or at Chiba (XForms based).

Posted by Stefan Chis on October 03, 2003 at 07:40 AM EDT #

why don't you applets?

Posted by pipi on October 03, 2003 at 08:37 AM EDT #

This look like .net web controls. Maybe holly gral of Java is Microsoft .NET ? Spadak

Posted by Spadak on October 03, 2003 at 08:49 AM EDT #

I am now working at a company where they have an a large investment in a custom javascript framework. It's hell to maintain and debug. An XML data island is sent to the client, - then javascript builds a massively complex UI from this. I am very interested in the alternatives. So far no replies are very convincing. I'd like to avoid re-inventing the wheel. I have a vague feeling that the whole idea is just too ambitious and some other client technology should be used, such as Swing. What we need is something along the lines of a webos.com or webfx.net library that also comes with taglibs.

Posted by James Head on October 03, 2003 at 09:34 AM EDT #

Alternatives? Ever consider Flash MX?

Posted by Carlos E. Perez on October 03, 2003 at 09:44 AM EDT #

Echo: http://www.nextapp.com/products/echo/ WingS: http://wings.mercatis.de/tiki-index.php Both frameworks are LGPLd, and have an interface that resembles Swing (or other MVC GUI APIs). I don't have any experience with them, but like the others said, I would consider using an alternative client technology. E.g.: applets/jws/flash.

Posted by Laszlo Marai on October 03, 2003 at 11:32 AM EDT #

webfx.net... just what i need a porn site at 8am...

Posted by S D on October 03, 2003 at 12:02 PM EDT #

Why not to use thin Java client? I.e. Swing of SWT/JFace based started from a Java WebStart? It will save you a lot of time on development and then on maintenance. And UI will be the way more accessible, faster and user friendly.

Posted by eu on October 03, 2003 at 01:04 PM EDT #

I found this: http://struts.application-servers.com/ . I've never used it but it looks like interesting.

Posted by Stefano on October 03, 2003 at 03:19 PM EDT #

You might wonna check out XUL (XML UI Language) for a richer markup than plain-old "classic" HTML. XUL includes tags such as <table>, <tree>, <stack>, <deck>, <tabbox> and many more. For more info check out the XUL Alliance site @ http://xul.sourceforge.net

Posted by Gerald Bauer on October 03, 2003 at 05:55 PM EDT #

ASP.NET does most of that. I see JSF as competition to dotnet Server Controls. But all those nice additions to server-side toolkits are quite beside the point, in my opinion. I could say much on this but I doubt it would make any difference... It is (has been for years) very irritating for me to hear managers say "I would like you to take this win32 app. and replicate it as best you can using HTML. And by the way make it compatible with NN4 and IE4." To think the thing's purpose was to allow me to edit paragraphs of black on white... There are some nice options available, like applets, smart clients, Flash. But as soon as you say the client needs a plugin or some runtime, your boss freaks out. Something that would be great is SVG+XForms or XHTML2 support in the leading browser for every major platform. I think we should be there by now. But that still doesnt give you the possibilities of rich clients...

Posted by Etienne on October 04, 2003 at 05:57 AM EDT #

Sorry about the webfx link. The correct link is of course: http://webfx.eae.net/ ..

Posted by James Head on October 17, 2003 at 01:24 PM EDT #

awesome site

Posted by pornstar finder on February 20, 2004 at 07:13 AM EST #

Post a Comment:
  • HTML Syntax: NOT allowed

« JavaLobby bloggers. | Main | JRoller.com. »

Welcome

This is just one entry in the weblog Blogging Roller. You may want to visit the main page of the weblog

Related entries

Below are the most recent entries in the category Java, some may be related to this entry.