WebWork doesn't Get AJAX

My adventure with WebWork 2 continues, and the disappointments keep piling on. The problem stems from the fact that almost every framework that sports ‘ajax’ support seems intent on shoehorning it into the existing paradigms, and so ends up failing miserably when you actually want to do Cool Stuff.

Here’s a simple example. I have an administration page, which has a number of checkboxes on it. These checkboxes toggle various bits of functionality. So for example, I could click the ‘tug penis’ checkbox, and that’d result in the server commencing penis tuggage. Ajax fappery means that I don’t have to have a submit, I can wire up (in theory) the checkbox to some method on the server, right? Nope, quite quite wrong in fact. This trivial example was in fact too complicated for poor old WebWork, and is not possible. Instead, you have to pretty much do all the wiring yourself.

The ajax support is in fact as pitiful as it could possibly get. All it does is do the odd bit of form validation. It won’t do ajaxified double select lists, it won’t really add any new cool components (not even standard ones like autocomplete boxes), it’ll just sprinkle some retard newbie myfirstajax type code in various places with no real thought or innovation.

Here’s a tip to all you web framework authors out there. If you’re going to stencil ajax on your collective genitalia, make sure you can deliver. You’re lucky that most of your users are struts rejects and have the communication skills of Kirk Pepperdine, and are thus unable to coherently form sentences vaguely describing their expectations, needs, wants, or even thought processes. Hell, you’re lucky your users more often than not don’t even seem to exhibit thought processes, let alone ones that can be expressed. It takes more than the odd ajaxy validation to impress. I want my ajax support to actually utilise ajax, instead of being a pathetic little demo for one gayass corner case.

Of course, it’s not surprising that nobody has really figured this out. There are now more ajax frameworks than there are web frameworks. There are frameworks that now layer over other frameworks. Most of these are even worse documented than web frameworks. In fact, the ajax landscape right now makes one really look back fondly at the Java web framework arena, which (amazingly) has a great deal of coherence by comparison.

For WebWork, I still find myself fighting the framework. It’s astounding that after all these years, web frameworks still don’t feel natural or elegant. My requirements really are simple:

  • Scalable (the site currently handles about a million hits a day)
  • Doesn’t have that moronic fuckwitty we-separate-concerns-but-still-demand-a-1to1mapping-between-pages-and-code. If my action class is GenitaliaManager, I should be able to have genitaliaUpdate.jsp, genitaliaRemove.jsp, and /genitalia/contribute.jsp if I want, all going off that same class.
  • No pretentious developers who look down on jsp as a view technology. Velocity is by, and for wankers.
  • Reasonable ajax support (optional).
  • No XML hell, annotations all the way.
  • Actually uses Java5.
  • Basic documentation.

    It’s depressing that based on what I know, no such beast exists. I’d be thrilled to be proven wrong, but it’s sad and pitiful that in this day and age, we still have no frameworks with these very basic capabilities. Am I missing something?

  • 41 Responses to “WebWork doesn't Get AJAX”

    1. Paunch Custard Says:

      Have you tried Rails? AJAX support is baked right into the framework, and I was up and running with a dynamic website with full AJAX support before I knew it! Another great thing about Rails is that everything is an object but it’s also a record and you can validate those objects because they are Active and Agile. The agility of it all really surprised me after coming from Java, which really feels like it’s only 48% agile for most tasks. I’ve found myself up to 93% agile with Rails (around 86% in plain Ruby.) I’m still proto-benchmarking the Extremity of Rails, but I can safely say there are x2 gains in this area over Java.

      BTW: if you need to answer the math question, just fire up a Ruby command line! Ruby can report the results of mathematical operations, too! Not just a web language! (Take that, PHP!)

    2. Troll Says:

      AS much as you just love Gavin King, Seam (in a roundabout way) has most of what you are looking for.

      You may be pleasantly surprised, but I doubt it. And it ties you to JBoss; which I’m sure you’ll just love.

    3. Troll Says:

      Rails … rails … reails. Gimme a fucking break. If PHP will do, fine use rails, but don’t pass this shit off as some serious enterpirse language.

      Clearly handling ones genitalia requires the nimble and deft touch of an enterprise framework.

    4. Anonymous Says:

      See, I’ve always felt that Java is more on the range of 44-47% agi… what the fuck?!?! Is this guy serious?

    5. Not Jacob Says:

      for once i agree with you :-) action frameworks are hard (albeight fast) and it’s funny that developers think ajax will make things easier for them. j1 should be interesting with all of these monolithic approaches to ‘integrating’ ajax frameworks instead of actually promoting new ideas–

    6. Foulmouthed Gentleman Says:

      The actual question is : how long are we gonna have to wait before Geert Bevin drops by to sell his own dogfood with his second grade DHHesque hipspeak…

    7. Dude Says:

      Such a framework exists and handles all your concerns. It’s called Java EE formally J2EE. Dump the the EJB’s and you have a very simple and elegant solution. All it requires is that you know how to design - but this a requirement regardless of what you’re coding. Another solution is to fire all your retarded developers.

    8. Jason Carreira Says:

      Umm… thanks for your constructive criticism…

      The Ajax stuff is pretty simple by design… I’d thought it was simple enough for even you, but I guess I was wrong ;-)

      Of course we don’t cover every AJAX usecase yet. No one does. There’s still plenty more to do, but for the most basic cases, like “I want this part of the page to refresh when I submit that form” or “Validate the form input while the user is entering it”, those are pre-packaged.

      At work we build a lot of custom AJAX components on the WebWork UI tag framework, but that takes some work, and would cut down on your genitalia tugging time, I suppose…

    9. Raunchy Mustard Says:

      Hey Paunch Custard, are you my lost brother who we lost on our family trip to Oregon in 76 and then - so the story tells - was raised by wolves? That would be totally agile.

    10. Jesse Kuhnert Says:

      I would disagree that no framework is supporting more of the core concepts needed. I think tacos has a lot more work to go (http://tacos.sourceforge.net) , but it at least does support basic things like wiring up javascript events to invocation of java server code.

      Of course this support is in a less than ideal form now, but when we are done creating the new “natural” API for this support in tapestry I think it will leave the others playing catchup for quite a long time. (Ie EventListener() annotations, JSON support, blah blah. ) We’ll see…I’m probably not one to talk since it’s not released yet :) It’s definitely a ~lot~ more than a passing fancy with one particular js toolkit.

    11. Jacob Says:

      Tacos looks cool, it’s on the *right* track– Oracle ADF has been doing something similar for a couple years now with JSF– and the 1.2 release of JSF has included a couple other features that will allow any old component dropped into a page and participate in AJAX/partial processing/RPC whatever, so it takes care of the ‘declared once’ with support for contextual evaluation within for loops, etc. Seam’s remoting is pretty cool, if you’re into RPC over AJAX. I do believe that component frameworks will win out with all of the handholding they do, they just need to get faster.

    12. Ladd Says:

      have you tried taconite, it seems to be framework agnostic, http://taconite.sourceforge.net/

    13. Jason Carreira Says:

      Yes, you always think component frameworks will win out… You’ve been believing that for quite a while now.

    14. Sean LeBlanc Says:

      First comment is killer. The bile is funny, but that comment made me LOL.

      BTW, with Lisp I have 3x gains in the AJAX area…

    15. Jesse Kuhnert Says:

      I hope this comment isn’t seen as defending Jacob, as I’m rather partial to disliking him, but dissing component frameworks is going a little far-ish.

      The last time I used an action based framework was a long long time ago when there were no java web frameworks(and dinosaurs romed the earth, walkd to school in snow..etc..), save for the servlet container and the jserv apache module. We developed an in house template engine similar to velocity.

      To figure out which code to call for things in forms or links we defined “actions” that tied them to “something” that would eventually map the action to an actual method call.

      I hated having to map these actions everywhere, if you broke out your design handbook of choice you’d find that this doesn’t feel very object oriented. In fact it’s pretty ass-backwards and retarded that people are still using them today. I always thought back then that it would be so much easier if I could just somehow bind these actions to the actual object.method I wanted to call.

      Now it seems that component based frameworks are ~actually~ object oriented. Not that it makes it a magic word where all your problems are solved, but it’s sure as shit a lot better than the mess created with “mapping” all of these other things.

      Sorry again for the strong words, I don’t normally pipe in and do things like that but couldn’t let this one slide without saying something. sorry

    16. Unlce Wiggly Says:

      < >

      You’ll be sure to let us all know when you are done, won’t you ? This rabbit gentleman, for one, is getting tired of working with less than ideal support. I do like tacos, especially with the spicy bits Nurse Jane always digs up in the garden.

      I was surprised, myself, at the ease of implementing full AJAX support in RoR - it turned out to require just two lines of RoR script to AJAXify all the interfaces throughout our site, which is currently supporting 72 billion transactions daily. Thanks to the Agileness of the RoR thought process and the Inversity of the Injections we Depended, in a Controlled yet Agile way, this work was done overnight, although our team had previously spent 17 years working on the problem.

      Now, at his age, the Wiggly One would be glad to have 48% Agileness, let alone the kind of RoR Activeness and Agileness recorded by Paunch Custard. But we really think that RoR goes beyond Agileness to a new paradigm of productivity - Acrobaticness, perhaps, or even Contortionistness. Or is there another word for bouncing-off-the-walls-like-a-goddamm-methedrine-ping-pong-ball-at-the-drop-of-a-hat kind of work group responsiveness ?

      Your Uncle would like to know.

    17. Jacob Says:

      Sorry Jason/Jesse, I hope this comment isn’t seen as defending myself, as I’m rather partial to disliking the chaos in the java mvc realm, but dissing me, personally, is going a little far-ish :)

    18. MagLiteNo1 Says:

      It is an excellent indicator of the current state of software evelopment that developers, especially in web development, speak only in Humpty-Dumptyisms.
      Thanks charlatans! Thanks for ruining my industry! I’m certain it’s oh-so-much easier to use all this garbage than to learn a couple of platform-native APIs. Anyway, if your software works then how will you charge for your “knowledge”?
      Please, all Web 2.0 believers, please fuck off and die immediately.

    19. RoR Says:

      Just use Rails bileboy. You know you want to. You could then be DHH’s little sidekick, concubine.

    20. The Dark Man Commeth Says:

      Try Stripes Hani, it’s a young project, but it’s the *only* current framework (besides possibly Wicket) that makes any goddamn sense.

      http://mc4j.org/confluence/display/stripes/Home

    21. Darth Vader Says:

      Give in to the dark side of the force and use JSF.

      Let my sith lord, Jacob, lead you to the way of Avatar and easy parchesey Ajax development.

      We have better docs and are not so infactuated with our members.

      Evil gets the chicks!

    22. Hadji Murad Says:

      RoR causes bloody square turds.

      However, with frameworks like EJB3, Struts and WebWork it is no wonder some Java developers are looking for other ways like RoR. “Please let me escape from this XML hell.”

      RoR is a dead end. It is the cotton candy, junk food of web development.

      I’ve been down this path and it is ugly!

      Let them go. Must of them are the same developers that put JDBC calls in their JSP and couldn’t understand why we hate Struts. We are better without them.

    23. dude Says:

      hadji, find some new quip– you aren’t near as funny or pointient as hani. anyways, hani has some 1337 moves. I’m serious, when you are dyslexic, the simple math questions suck.

    24. Darth Vader Says:

      Dude,

      Why go with new when you have an instant classic?

      RoR stinks! Sing it loud and proud.

    25. uke Says:

      Do you put yourself in pain because your employer told you to do that, or you like feeling pain in your genitalia? Is exploring the sores of WebWork your own idea of having fun?

      I really, really, really want to see your bile about Stripes.

    26. Dr. Confused Says:

      Hani,

      This blog looks like shit (expanded with the content going under the right menu) on firefox with 1024×768 resolution.

    27. Jason Carreira Says:

      Dr. Confused,

      If you have the web developer plugin for Firefox, you can edit the CSS and add

      display: none

      to the #SideBar style to make that crap go away…

      Jacob, I don’t think I made a personal attack… I said I know you think Component Frameworks will win… I DO know that. My sarcastic point was that you tell us all the time. We get it.

    28. Jacob Says:

      Just j/k’ing Jason :-) i’m hoping around J1, with the Seam/JSF guys, that we can start looking at a separate, standardized packages of MVC-related annotations that we can all leverage within our frameworks– if only some validation apis or something else to piggy back on EJB 3’s interceptor stuff under javax.*

    29. Brian Says:

      You dolt, your second bullet point is just plain wrong. You can have as many different actions/results bound to as many classes as you want. Each one just needs to have a seperate method inside your GenetilaManager. Fuck, if you want the same action to map to different pages make your own fucking result type.

    30. Mr. T Says:

      Ya’ll goin’ to hell. ASP.NET is the FRAMEWORK of choice for development scalable Java Apps integerated with AJAX and other cool stuff. It also comes built in with full support for Ruby and Rails doohickeys, I hear Billy Bob G-Funk Gates is going to release the next version of ASP.NET that will fully integerate Google Maps services and Amazon Book Buying crap, so be happy you little chipmonks, Billy will take care of all ya’ll. ;)

    31. good Says:

      Jboss Seam has all features you want, Mr Hani.

    32. Trejkaz Says:

      Rails fails it because of the requirement that it “actually use Java5.” Sorry, Ruby folk. I love it too, but it clearly doesn’t meet this list of requirements. Maybe try later, once the Ruby interpreter has been fully ported to Java?

    33. Pat Gnowall Says:

      I have to wonder if you all understand each other’s witty little inside quips, or if it’s all as opaque to you doughy developers as it is to everyone else.

      The commentary on frameworks would be interesting if it weren’t completely obfuscated with unfunny sarcasm, esoteric allusions to other pot-bellied programmers, and oneupsmanship on acronyms and open-source project minutiae.

      There should be a warning on these things that says: “This blog and all commentary intended for 12 guys who met at BiMonSciFiCon and can’t get anyone to listen to their inane drivel at the office. References to topics of interest are purely there as a vehicle for their crumb-bearded, nonsense-blathering, pissing contest.”

    34. John D Rockefeller Says:

      < <
      Atlassian releases JIRA 3.6

      Stripes 1.3 Web Application Framework Released

      Stripes 1.3 is the first release to be distributed under the Apache License.
      >>

      Holy Cow ! The Bile should really start flowing now …

    35. Uncle Wiggly Says:

      < < Just j/k'ing Jason :-) i'm hoping around J1, with the Seam/JSF guys, that we can start looking at a separate, standardized packages of MVC-related annotations that we can all leverage within our frameworks-- if only some validation apis or something else to piggy back on EJB 3's interceptor stuff under javax.* >>

      Wow !!

      Once more, your dear old Uncle Wiggly asks you to make sure you let us all know when that happens … OK ?

      Because the Wiggly One knows for sure that ’some validation apis or something else to piggy back on EJB 3’s interceptor stuff’ and ’separate, standardized packages of MVC-related annotations’ will change our world down here on the farm … and depending on what the ’something else’ turns out to be, may cause us all to consider Radical Changes to our career plans.

      < <..if you have the web developer plugin for Firefox, you can edit the CSS...>>

      So much that is wrong about the Web illuminated in a small snippet of tech-speak. Depressing … time to hit the carrot cider for the day …

    36. Zarar Siddiqi Says:

      > Actually uses Java5.

      For what its worth it comes with xwork-tiger.jar which eases the converstion process between request parameters and Java objects.

      http://www.opensymphony.com/webwork/wikidocs/J2SE%205%20Support.html

      Overall, WebWork rules.

    37. Speedy Jim Says:

      I’ve been a Java web developer for 4 years and, with the exception of the swear words and Trezjak’s post, none of this means *anything* to me.

      Either I’m incompetent and know nothing or this argument is a load of techno-name-dropping pretentious arse

    38. surprised Says:

      “o pretentious developers who look down on jsp as a view technology. Velocity is by, and for wankers.

      I know you don’t like the apache stuff but thats insane if you don’t like to debug jsp all the time.
      What’s wrong with velocity?

    39. RepoMan Says:

      SpeedyJim, it’s not an “either or”. It’s more like a “both”.

      Seam does rock, though.

    40. Douglas Says:

      You want scalability *and* for every check box to make a server request? Do you know what you’re asking for?

      Douglas

    41. Jevgeni Kabanov Says:

      Aranea fits that description, except it just doesn’t need annotations or configuration at all. Scalability might be a damaging factor in your case, we have support for stateless services, but we concentrate on the stateful components at the moment, so this area is underdeveloped at the moment. Tons of documentation though :)

    Leave a Reply