views:

317

answers:

5

I have been learning ASP.NET MVC in the last few months and I think it is a great improvement over ASP.NET. For me personally, it is a joy to use (as opposed to ASP.NET WebForms :)) I started wondering how the .NET world managed to live so long without any such framework (at least not wide spread and supported by Microsoft as there may be .NET ports of Java MVC frameworks, like Spring.NET).

I know Java folks had such frameworks for a long time and there are many Java MVC frameworks available.

If a web developer was thinking about switching from Java to .NET, which Java framework can be the easiest to switch from, and vice versa, if an ASP.NET MVC developer is thinking about broadening his skillset and learning some Java MVC (web) framework, which would be most similar to ASP.NET MVC architecture- and feature- wise?

Which Java MVC framework is most similar to ASP.NET MVC?

A: 

From Wikipedia:

JSF features a component based approach to WebApplication development similar to ASP.NET
Bozho
I am not interested in ASP.NET (WebForms) but rather ASP.NET MVC.
Marek
"The mainstream view engine used in the ASP.NET MVC Framework is the WebForms view engine, which ships with the framework itself."
Bozho
I do know about ASP.NET MVC. Excuse me, but it seems to me you don't :) The fact that the default view engine in ASP.NET MVC is WebForms view engine has absolutely no relevance to my question.
Marek
Well, I haven't written ASP.NET MVC, but since JSF is also an MVC framework, and is also component based, I still think JSF an appropriate answer.
Bozho
Just to clarify, ASP.NET MVC is NOT component based, its action-based.
Guilherme Oenning
+1  A: 

Apache Struts :

Apache Struts is a free open-source framework for creating Java web applications.

Web applications differ from conventional websites in that web applications can create a dynamic response. Many websites deliver only static pages. A web application can interact with databases and business logic engines to customize a response.

Web applications based on JavaServer Pages sometimes commingle database code, page design code, and control flow code. In practice, we find that unless these concerns are separated, larger applications become difficult to maintain.

One way to separate concerns in a software application is to use a Model-View-Controller (MVC) architecture. The Model represents the business or database code, the View represents the page design code, and the Controller represents the navigational code. The Struts framework is designed to help developers create web applications that utilize a MVC architecture.

The framework provides three key components:

  • A "request" handler provided by the application developer that is mapped to a standard URI.
  • A "response" handler that transfers control to another resource which completes the response.
  • A tag library that helps developers create interactive form-based applications with server pages.

The framework's architecture and tags are buzzword compliant. Struts works well with conventional REST applications and with nouveau technologies like SOAP and AJAX.

SjB
Thanks for copy pasting from description that can be read if anyone follows the link :) Could you please elaborate on similarity with ASP.NET MVC?
Marek
I don't work with asp mvc but I heard struts is likely to asp mvc
SjB
A: 

Wikipedia has a list of a bunch of frameworks here:

http://en.wikipedia.org/wiki/Comparison_of_web_application_frameworks

and of those based on Java technology, about half are component based (that's what you don't want) and the other half MVC. If interested, you could follow the links on some of those to get more information.

In general,

  • the more mature of them will have more detailed writeups - both in Wikipedia and in the wild. There will also be more documentation, sample code, tutorials,...

  • The younger ones may be simpler, more fun, more versatile, as they build on the older ones, eliminate known shortcomings and add new features. JSF and Struts, for instance, are "big" in the industry but are considered by many developers (citation needed, I know) to be dated, clumsy, bloated, etc.

You'll probably have trouble getting an answer from people with enough experience to directly compare products on the .Net and Java side; most developers tend to stay on one side of that fence.

While I'm not knowledgeable about similarities with ASP.Net, I submit that Struts and JSF are the workhorses of industry on the Java side, and would be the kind of thing to be useful to have in your CV, even though or perhaps because they're not modern or sexy. Of those two, I think Struts has more of an MVC feel to it.

Carl Smotricz
+1  A: 

If I were looking for the simplest framework, I'd dive into Struts. Struts 1.0 was written in a day, and is possibly the most valuable hour-per-hour effort ever spent by a programmer.

If I were looking to broaden my knowledge and/or skills, I might lean towards Spring MVC. If you need some functionality for Java web development, odds are other people wanted it too, and that Spring already has it. (Spring is larger than just Spring MVC; you can simply use Spring MVC, but it integrates nicely with much more, if you choose.)

Dean J
I think that may be leading away from the OP's question about something comparable to ASP.NET MVC. Spring tends toward programming your entire application in XML, and opinions differ on whether this is a good thing or not :)
Carl Smotricz
If you mostly ignore IoC, and use singletons where they logically fit instead of Spring-wired-beans, you can do Spring with very light XML.
Dean J
+2  A: 

SpringMVC, VRaptor, Grails (Not Java, but somewhat relevant on the Java world)

Lucas
Thanks, I have looked at VRaptor, the controllers look similar to the approach taken by ASP.NET MVC, but I strongly dislike XML configuration for everything (SpringMVC seems to be the worst case in this aspect). And Groovy is too exotic a language for me...
Marek
The only mandatory configuration on VRaptor is the packages for the IoC Container to scan your classpath. The other options are only for override some framework behaviors (Enconding and a custom Provider).
Lucas
Yes, I already found out that there is not so much XML configuration involved. VRaptor is very nice and indeed very similar to ASP.NET MVC. Thanks!
Marek
See also Jersey framework!
synergetic