Rafał Wrzeszcz - Wrzasq.pl

ChillDev-Facelets - various Spring-based Facelets handlers

Wednesday, 12 November 2014, 22:27

Digging more and more into Java and building more and more apps with Spring I began to discover more and more technologies. One of my, probably key, decisions was to use Facelets as a view technology. Seems to be quite simple, but it isn't so - first of all Spring has a very limited integration possibilities for Facelets views; secondly Facelets are based on a different concepts than classic view templating engines like JSP, Velocity etc.; and finally Facelets are strictly designed for JSF framework so some of core features depend on it. But it's not impossible! Basic integration with Facelets is provided by Spring itself by variable resolver class that resolves Facelets variables by using Spring beans. Even better integration is possible by using Spring Web Flow which provides view resolver. What is missing is the integration of many core components, which are available in JSP tags. I began to create taglibs to fill missing gaps.

Tags: XHTML, Web, Forms, Spring, Tutorial, ChillDev, Java, Facelets

» Komentarze

Symfony2 - creating adapter-dependent sub-forms

Wednesday, 11 September 2013, 19:04

I think this is quite commonly needed feature - form structure that vary depending on some other field(s). The project, on which I'm currently working, is integrated with a lot of external APIs which usually require additional per-user options for each of them. It's a SEO tool and - to pick an example - provides various indexing services integration. Some of them require API key, some require login and password, some specify different URLs. So for each of them form structure can differ. Of course you could use some conditions to pick correct structure, but it's not enough - form needs to change together with selected option. There are some partial tutorials on the web how to alternate form based on events, but it's just one part of the solution - here is more complex one.

Tags: Symfony, Forms, Code, Tutorial, PHP

» Komentarze