Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Customization of JSF 2.0 based application

 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,

at my company we're working on our major product which is a web applications based on Struts 1.x. Because of its age and all the well-known problems of a legacy application we're currently looking for alternative modern technologies to start a migration of the old app.

A major challenge and requirement is "customization". The core of the application is the same for all customers although there are a few parts which are specific to one customer. But the biggest customization is necessary for our view templates (which use an own XML based format at the moment). This is important because the web interface has to be tailored to conform to the corporate identity requirements of the customers. This does not only mean some different colors but instead for one customer a menu can be placed on the right side for another it can be placed on the left. Additionally there may be some smaller differences like single menu items which may be only visible for some customers but not for others. The concept we use at the moment offers a very basic overriding mechanism. There's one common pool of XML templates which can be overridden with a customer specific version. The rest of the visual differences are produced with different XSL stylesheets and CSS. But unfortunately everything is very complex so it's almost impossible to let a web designer do his job instead of a developer (who is probably not as good in web design).

From what I know and read so far the templating features of JSF 2.0 in combination with ordinary CSS stylesheets look very promising to me. Unfortunately I'm not an expert in web design. So it's hard for me to judge if JSF 2.0 could be a potential solution. On the other hand we need a complete new framework (not only the view layer) and I like the rest of the JEE 6 stack already very much. From this point of view JSF 2.0 would make perfect sense to me. Moreover I don't know of any existing alternative solution which would make it much easier to handle our requirements which can become complex from time to time.

Marco
 
Jason Porter
Author
Ranch Hand
Posts: 126
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, JSF 2 (or even 1.2 with Facelets) would fit this perfectly. I prototyped this at my last job. It's really not that hard to do. You'd just use a different template for each customer (in your template declaration you'd use an EL expression for whichever template you'd need). You can also expand this even further because each composition can have it's own template. Most of the things I've seen done with facelets don't really need anything this complex, but there's A LOT of power there just waiting to be utilized to it's fullest.

Basic HTML + CSS best practices will get you a long way as well (using divs, moving things around on the page with CSS, etc).

If you decide not to go with JSF I'd recommend looking at sitemesh.
 
Marco Ehrentreich
best scout
Bartender
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jason,

thanks for sharing your experiences and ideas!

Luckily this confirms what I already thought after a few experiments and reading some documentation. But I think there's no better way to find out than to give it simply a try and do some prototyping

Marco
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic