1

At work we're discussing upgrading our view layer for our web application. We're currently running an old and "modified" version of FreeMarker Classic, which is a pain to work with. One of our developers suggested using a Component UI style architecture similar to desktop style environments.

Essentially, this would mean that you would build custom HTML components as Java Classes that the controller would render into the Document view. This would completely take away the need to write HTML into a view layer. The Components would generate the view layer for you.

For instance, the following rendered HTML:

<h1>I am a title</h1>
<p>I am a paragraph.</p>

Would be generated by doing something like:

String titleString = "I am a title";
html.elements.Heading heading = new html.elements.Heading(Heading.H1, titleString);

String paraString = "I am a paragraph.";
html.elements.Paragraph paragraph = new html.elements.Paragraph(paraString);

PrintWriter somePrintWriter = new PrintWriter();
Document document = new Document();
document.addElement(heading);
document.addElement(paragraph);
document.compose(somePrintWriter);

The above code is just an example, don't critique the names or style, I just wrote it for a quick demonstration of what we may be trying to accomplish. I'm trying to determine if this has been done before in Java, and if so if there are any links I can be pointed to. I've been researching it as much as I can, but haven't found any implementations that completely remove the template layer (such as JSP or JSF).

Thanks!

4
  • Do you not want a template layer at all? I made a post but quickly deleted it when I read your last sentence. Commented Aug 19, 2009 at 22:35
  • Right, we're trying to see if we can eliminate templating entirely, since all the business logic in the controller can handle what is presented in the view. Commented Aug 19, 2009 at 22:42
  • Lots of the answers are centered on full-fledged frameworks. It's great to see, but we're more interested in just the GUI toolkit that we can integrate with our existing system. Not sure if it's out there, but all the same, just want to be clear. Commented Aug 19, 2009 at 22:58
  • @localshred check out JAVA FX Commented Sep 13, 2013 at 17:24

5 Answers 5

2

There is a pure Java way where EVERYTHING is built using Java. Check it out here http://www.zkoss.org/

UPDATE: I found even better one. Also pure Java. http://vaadin.com/home

Sign up to request clarification or add additional context in comments.

Comments

0

How about GWT?

1 Comment

This seems more geared towards Ajax that we are looking for, unless I'm completely missing something. It is definitely along the same lines though.
0

Echo2/Echo3 might be useful.

Echo is a platform for building web-based applications that approach the capabilities of rich clients. The applications are developed using a component-oriented and event-driven API, eliminating the need to deal with the "page-based" nature of browsers. To the developer, Echo works just like a user interface toolkit.

1 Comment

This looks like the closest thing to what we are trying to accomplish. The only thing is that it is an entire framework, which we wouldn't have the ability to implement. We're looking strictly for the view architecture.
0

I used GWT-Ext to create a desktop-feel for a Java-based web app. It was very well received and feels very much like you are not within a web browser at all.

1 Comment

I'll check this out, but I'm not sure we're looking for a SproutCore type implementation, where the app looks like a desktop app. We just want the component UI style techniques.
0

Click is pretty close, to what you are describing. It does use Velocity, but if you take a look at the Advanced Forms example, the template was very basic.

wingS is another one that looks to be close to what you want. It is supposed to be Swing like.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.