Month: November 2007

Comments, again

Seems like I fucked up the anonymous reply function somehow which always led to an (invisible) form validation error. My apology to all the people who tried to comment and couldn’t. I would restore the comments but my logs only show that people tried to comment and not what they wote.

Spring Praxishandbuch

I’ve been working a lot with the Spring Framework again in the last year. Apart from lots of my work involving it and the JsServ Interceptor I wrote last weekend, another result of this is a book some people from my company wrote. It is about Spring and integrating other technologies into it. It is meant to focus on the practical aspects and tries to explain some exemplary solutions to common problems encountered when working with Spring.

I wrote an awesome chapter about web development with Spring which contains examples for creating a little shop application with a REST-like interface in Spring Web MVC and Spring Webflow. 

So if you like a read a brilliant book Spring development, go and buy it 🙂. This might work best if you can read German, but you can buy one anyway if you don’t. Hell, buy two and give one away for Xmas.

The book and example code should be available in a few days. 

Links:

JsServ – Serverside Javascript and DOM emulation

I played around with some ideas about JavaScript on the server-side and came up with this little prototype. It’s a set a spring components that allow running the scripts in a website on the server side in case a user has no support for JavaScript or has disabled it.

The following diagram shows the way things work:

The parts of jsserv

The parts of jsserv

The DOMInterceptor intercepts the HTML output of other controller and initializes a dom state with it. The document itself is parsed into a DOM tree and the referenced scripts are loaded and executed. Additional patch scripts can be defined to alter the behaviour of other scripts.

The current version adds
<a class="eventHelper" href="/app/event?uuid=42">...</a>

Links around every element for which a onclick handler is registered. The links point to a DOMEvent Controller that triggers updates in the user’s DOM State.

A little example scripts implements a collapsable tree that changes the style classes of nested unordered lists. With the JsServ DOM Manipulation this works with JavaScript as well as without JavaScript on the client side.

While this code is only a rough sketch it promises a lot in terms of vastly reducing the amount of work for sites that must use javascript to get an optimal user experience but who cannot or want not to have a java-script only site. Although the link-as-click event method is rather limited, it is good enough to make a lot of DOM manipulations possible. Expressed only once in JavaScript. Running in it’s deluxe form for people with client-side JavaScript and in a basic form for people with the help of using server-side JavaScript. All is seamlessly integratable into all kinds of Controllers.

Links:

Dependencies:

Edit: code.google.com link added, update to 0.12

© 2024 fforw.de

Theme by Anders NorénUp ↑