A
A
Artouiros2011-07-17 15:00:24
Java
Artouiros, 2011-07-17 15:00:24

Choosing a Java Framework for Web Development?

I never considered myself a web developer, but the time has come to fix this matter. Please tell me, under what framework is it easier, more convenient, faster to work? Looked at tapestry5, play framework, Grails. Of the three, tapestry looks the best in my opinion. But surfing the Internet showed that for some reason he is not very popular.

Answer the question

In order to leave comments, you need to log in

11 answer(s)
M
malexejev, 2011-07-18
@Artouiros

Depends on the application and architectural requirements.
First, component or action-based?
Component-based - easy to write (ie "develop large complex guis") but it takes a long time to develop custom components, the application will be heavier (slower) on average and will eat more memory (especially JSF implementations with conversation state stored in HttpSession) per user. In addition, they are often difficult to cluster due to poor session usage by libraries.
From component: JSF (XxxFaces), Tapestry 5, GWT. I do not recommend Tapestri 5 - I had experience in developing a large public site on it. I would advise you to try GWT - I heard a maximum of positive feedback from people who did something on it. Again, I personally do not recommend JSF - you will immediately lose control over what is in your session, the application will become “heavy”.
Action-based frameworks: development is a little slower, it is easy to make the application stateless and get simple clustering, the application is lightweight and fast.
I recommend the following combinations: Spring MVC + FreeMarker, Spring MVC + Velocity, Spring MVC + JSP 2 (EL-based). I heard positive things about Stripes (but it is obviously less popular than Spring MVC) and Play (everyone is good, except for strange architectural quirks - for example, it is proposed to shove business logic into the model, and not into a dedicated service layer. one thing is likely to be critical for you).
Then, what else needs to be considered -
1) HTML is not XML. If the template engine uses XML, this is not very good. DOCTYPE, browser-specific comments will have to be inserted via hacks.
2) streaming, not buffering. The correct work with the web is to write to the outputStream along the way, and not to save a line and then throw it away entirely. Almost all component frameworks suffer from excessive buffering, many action-based ones too. Hence the high memory requirements, OOME when generating heavy pages, etc.
3) Pay special attention to how Layouts are made in the chosen framework - they should be convenient (ie. closer to Django-style) and implemented without buffering (see point 2)
4) If your framework dictates to you one specific stitched javascript -library - think twice. For an intranet application, this might work. For public - I would take another framework. GWT seems to be used in public, but I personally have not worked with it.
5) If the service needs a REST Api, immediately take a framework that has it, and don’t rely on chance.
On the whole, yes. Give more requirements for the application - I can advise something more specific.

I
isden, 2011-07-17
@isden

IMHO, Hibernate + Spring for the server side. Optionally - GWT for the client.

J
Jamon, 2011-07-17
@Jamon

Look towards PrimeFaces

I
inheaven, 2011-07-18
@inheaven

Wicket wicket.apache.org
Wicket + jQuery code.google.com/p/wiquery/

Z
Zamorozka, 2011-07-25
@Zamorozka

If you want to immerse yourself professionally, then I advise:
data level - hibernate
business - spring 3.x (mvc, security etc...)
view - freemarker + jquery
Well, if for a pen test, then - spring roo!

B
bald2b, 2011-08-02
@bald2b

Maybe I'm backward, but I write in Servlet + JSP + JSTL in a close bundle
Pluses - full control over everything, no annotations, bundles and rules, clouds of xml and .properties, the output is exactly what you want, and not what the framework will generate.
Cons - you have to write a lot of routine code with your hands, and the output will be your own framework with blackjack and hibernate.
But for small sites, I think the approach is justified

M
mhspace, 2011-07-17
@mhspace

Maybe the Google Web Toolkit.

S
Stanislav Agarkov, 2011-07-18
@stas_agarkov

As far as I know, the best framework for Java is Stripes. If you are interested, I can tell you.

A
Alexey Pomogaev, 2011-07-18
@Foror

grails, but rather python + django or ror in general, if you need to quickly do something, something template.
tapestry5 - if you figure it out, then you will have a very powerful and flexible tool for developing websites and web applications of any complexity. But you need to cut a lot yourself. Although with plugins there is now better. There are already standard sets of libraries, you can find them on the site.
Another option wicket+spring see

V
VSZ, 2011-08-16
@VSZ

I have experience since Struts 1.1 and I can confidently say that Wicket is one of the most elegant web frameworks. At one time, it somehow competed with Tapestry, but what bothered Tapestry was the constant invention of bicycles, buggy and long releases
In Wicket, everything is more dynamic and much simpler:
1) no need to deal with HTTP at all
2) no need to work with http session
3) it’s a pleasure to start working with Wicket, no configuration is needed - all configuration is Java code
4) forget what the thread safety requirement is for implemented pages
5) one of the simplest template mechanisms (in Wicket it is pure html)
6) good level of security
7) good integration with spring security
8) a high level of component reuse. It’s very easy to write components on it, take, as an example, creating a panel with controls and an html template and then completely reusing it in all the necessary pages
. I’m definitely not against action based approaches and other frameworks, but for team development of web applications it is much better than the same Struts , Spring MVC and hedgehogs with them.
PS: yes, and don't forget to use maven for infrastructural project management

E
endymion, 2011-07-21
@endymion

GWT/Vaadin + Spring/Guice + MyBatis (to hell with Hibernate!).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question