Re: Recommendations for a web application framework?
- From: Timo Stamm <timo.stamm@xxxxxxxx>
- Date: Fri, 07 Jul 2006 00:37:24 +0200
Chris Smith schrieb:
Alan Meyer <ameyer2@xxxxxxxxx> wrote:Do you or Chris think that using JSF is better than using, say,
Webwork or Spring? Or perhaps that it's just another approach?
I definitely feel that JSF is a better idea than Spring-MVC. I don't know much about WebWork, but I'm pretty skeptical of new revolutionary web application frameworks these days. One huge advantage of JSF (in my view) that applies versus most anything else is that it is the standard framework for web application development with Java. As such, I would need a pretty good reason to switch away from it. I haven't seen anything else that really is such a good reason.
JSF does an excellent job of separation of concerns.
Do you mean separation of HTML and Java or separation of business objects and view code? In my opinion, even PHP template libraries like TAL do a better job of separation in both respects than JSF.
[...] With JSF, I can actually build my entire Java code without having to think about the view layer at all; [...] In almost everything
else, you have to do this naming convention junk between "form beans" and HTML forms, and the form beans are not really all that abstracted from basic HTTP parameter handling.
That's Struts. But Struts is the oldest (and most outdated) of all Java Web Frameworks I know. There are many Frameworks that hide HTTP entirely. With some, you don't even have to care about request-response cycles: Let's say that I want to display a number on a web page, and increase the number by 1 everytime the user clicks a link. Using Struts, you would probably store the value in the session.
In a more advanced framework, it might look like this:
Java code:
public class CounterPage extends WebPage {
public int counter = 0;
public CounterPage() {
add(new Link("increase") {
public void onClick() {
counter = counter + 1;
}
});
add(new Label("counter", new PropertyModel(this, "counter")));
}
}
HTML:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:wicket="http://wicket.sourceforge.net/">
<head>
<title>Counter Page</title>
</head>
<body>
<span wicket:id="counter">[counter value will appear here]</span>
<a wicket:id="increase">increase counter</a>
</body>
</html>
Model and view are glued together by simple Classes. In this case, a OGNL expression is used.
JSF is just too complicated for my taste, but it certainly is the best choice for large applications because it is the official standard, has support of many vendors and a many available programmers.
Timo
.
- Follow-Ups:
- Re: Recommendations for a web application framework?
- From: Chris Smith
- Re: Recommendations for a web application framework?
- References:
- Recommendations for a web application framework?
- From: Alan Meyer
- Re: Recommendations for a web application framework?
- From: David Segall
- Re: Recommendations for a web application framework?
- From: Alan Meyer
- Re: Recommendations for a web application framework?
- From: Chris Smith
- Recommendations for a web application framework?
- Prev by Date: Re: eclipse is confusing <project vs workspace>
- Next by Date: Re: eclipse is confusing <project vs workspace>
- Previous by thread: Re: Recommendations for a web application framework?
- Next by thread: Re: Recommendations for a web application framework?
- Index(es):
Relevant Pages
|