-->

Recommendations for a Java 1.4 MVC framework for J

2019-08-22 17:50发布

问题:

I am revisiting a project and need to limit it to Java 1.4 (unfortunately). I was interested in introducing a MVC framework to improve ease of maintenance in the future.

Besides Struts 1, what options do I have? The lightweight the framework, the better.

Not to dismiss Struts off hand, I've just heard a lot of bad things about it. If anyone wants to defend it here, please do so.

Additionally the framework has to be able to run on Jrun, which may limit my choices. I can not, for example, get Spring MVC to work.

回答1:

I found this question while looking for something else, so I apologize that this answer may not find you in time.

There is a great option for your needs! The MVC framework is Induction, it is written using JDK 1.4. Induction controllers are multi-action, like Spring MVC 2.5, but Induction does not use annotations or XML, the controller get auto-wired by default.

Induction is an extremely light-weight and fast MVC framework (7.7K lines) but has many features absent in the major MVC frameworks, such as:

  • dynamic reloading during development when you change the controllers, views, models
  • file uploads so simple (not much different that a string input)
  • no configuration required for controllers
  • capability to analyze dependencies between your Models, Views and Controllers using your IDE
  • regular expression based URL mappings
  • best support for managing redirects of any MVC framework

Check out the getting started tutorial here: http://www.inductionframework.org/getting-started-tutorial.html

Good luck!



回答2:

Spring MVC is extremely lightweight. You can use as much of Spring, or as little of Spring, as you want.



回答3:

Although JSF is hard to understand at the beginning I like it more than Struts 1, in Java 1.4 I used MyFaces to build an application and it worked well for me.

Also I voted up Spring MVC proposal ;)