ASP.NET MVC框架端口的Java EE? [英] ASP.NET MVC framework port for Java EE?

查看:160
本文介绍了ASP.NET MVC框架端口的Java EE?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我用ASP.NET MVC框架的新,目前还没有最终发布打出了一些,我觉得它是非常漂亮和优雅。然而,在工作中,我们依赖于Java暂时,所以我不知道这一点:有没有框架的一个端口在那里为Java的人喜欢自己?我认识到,web表单不会可不幸的是,但怎么样的路​​由框架?

So I've played some with the new, not yet final release of ASP.NET MVC framework and I find it to be very nice and elegant. However at work we are tied to Java for the time being, so I'm wondering this: is there a port of the framework out there for Java people like myself? I realize that webforms isn't going to be available unfortunately but what about the routing framework?

推荐答案

看看的 Spring MVC的。就像Spring本身,它是pretty使用方便。官方的春天文档包含关于Spring MVC的一个一步一步的教程即很不错的。

Take a look at Spring MVC. Like Spring itself, it's pretty easy to use. The official Spring docs contain a step-by-step tutorial on Spring MVC that is very good.

我没那么熟悉ASP.NET MVC的,但它应该是类似pretty。

I'm not that familiar with ASP.NET MVC, but it ought to be pretty similar.

您实施控制器包含的handleRequest(HttpServletRequest的,HttpServletResponse的)方法,该方法返回一个的ModelAndView 对象。那么响应被分配到您的视图(可能是一个JSP文件),允许从实际JSP文件你完全独立code。

You implement a Controller that contains a handleRequest(HttpServletRequest, HttpServletResponse) method, which returns a ModelAndView object. The response is then dispatched to your view (probably a jsp file), allowing you to completely seperate code from the actual JSP file.

我知道,ASP.NET MVC自动被URL请求映射到控制器,以及不同的URL映射到不同的动作(如Ruby on Rails的,我觉得呢?) - Spring MVC的不这样做(除非你改变 DispatchServlet 的行为,我认为)。相反,你映射所有 *。HTM 请求(或 *。JSP *。做,或任何扩展你想要的)Spring的 DispatchServlet ,它读取的ApplicationContext (一XML文件),以确定哪些控制器映射到你的将hello.htm 请求。

I know that ASP.NET MVC automatically maps requests to controllers by the URL, and different URLs map to different "actions" (like Ruby on Rails, I think?) - Spring MVC doesn't do this (unless you change the behavior of DispatchServlet, I think). Instead you map all *.htm requests (or *.jsp, or *.do, or whatever extension you want) to Spring's DispatchServlet, which reads the ApplicationContext (a XML file) to determine which Controller to map to your hello.htm request.

Spring MVC的也给你一个系列<一href=\"http://static.springframework.org/spring/docs/2.5.x/reference/mvc.html#mvc-controller-command\">other控制器的,如果你正在寻找增加更多的功能,如 SimpleFormController中,你可以使用 AbstractWizardFormController 以创建精灵般的形式多页/流。

Spring MVC also gives you a series of other Controllers you can use if you are looking to add more functionality, such as SimpleFormController and AbstractWizardFormController to create wizard-like forms with multiple pages/flows.

我希望使用Spring MVC的工作来代替一系列不过是几十个JSP文件的应用程序,没有中间或业务层,code的生活并排侧scriptlet标记旁以HTML内容。这是一个维护一团糟。我很高兴地看到Spring MVC的会为我们做这个替换

I'm looking to use Spring MVC at work to replace a series of apps that are nothing but several dozen JSP files, with no middle or business layers, code that lives side-by-side in scriptlet tags next to HTML content. It's a maintenance mess. I'm excited to see what Spring MVC will do for us in replacing this.

这篇关于ASP.NET MVC框架端口的Java EE?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆