I am in the process of writing a Java based web site. I am trying to figure out how to manage some of the content that will appear on different pages. Obviously I don't want to hard code the content; but on the other hand I also don't feel like using a full blown CMS like Alfresco or OpenCMS since I think that it is complete overkill for my needs.
So my question to the experts out there is what is a good way to separate content from the code and maintain it independently without resorting to a large scale CMS? There has to be some sort of middle ground that allows me to change content without having to redeploy the code or go through the other extreme with some large CMS. I don't need all that workflow or versioning stuff etc. Maybe there is an open source library or API that allows you to manage content in a simple way. So what are the opinions out there?
Che开发者_如何学Goers, Luis
Beside Tomislav interesting advivce,
You can rely upon template engine (like freemarker or velocity or stringtemplate) to have on one side your page content and on the other your page rendering. This is, in a more evolved fashion, what good old JSPs used to do. But with a twist : using these template engine, your pages can be easily loaded from XML, as an example (I know, for having used recently freemarker on a personnal project that is is quite straightforward).
Alfresco is not designed to build web sites on (although yes, you can). You could try with Daisy ("a comprehensive content management application framework") or one of the other similar solutions from the open source CMS in java directory.
In the end, you might fall back on a relational database and the web interface technology you are most familiar with. Having said that, I would expect Grails or Rails might offer the best value-for-money if you're aiming for a moderately complex web site (authentication, separate back and front end etc.).
精彩评论