将整个应用程序从简单的Java迁移到Spring MVC [英] migrating a whole application from simple Java to Spring MVC

查看:95
本文介绍了将整个应用程序从简单的Java迁移到Spring MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的应用程序在简单的Java代码上运行。
有一台服务器从客户端获取数据并将其打印回来。

I have one simple application running on simple Java code. There is one server which takes data from client and just prints it back.

现在我想将此应用程序移动到Spring MVC,以便我的服务器将是运行24 * 7,任何客户端都可以从网络上实例化。

Now i want to move this application to Spring MVC so that my server will be running 24*7 and any client can be instantiated from web.

那么我需要做些什么改变?
如果需要可以详细解释并发布代码。

So what are the changes i will need to do ?? if required can explain in detail and also post code.

推荐答案

首先获取Spring Tool Suite并使用它为您的IDE。这是一个很好的帮助,因为它带有项目模板,如MVC,您基本上只需将现有代码插入(假设您的代码已经以其他应用程序可以使用的方式编写)。

Start by getting the Spring Tool Suite and use that for your IDE. It's been a great help, since it comes with project templates, like MVC, that you can basically just plug your existing code into (assuming your code is already written in a way that can be used by other applications).

一旦你有一个基本的MVC项目,你可以慢慢添加你自己的代码。

Once you have a basic MVC project, you can slowly add in your own code.

有关Spring MVC表单的更完整示例应用程序中,Spring Security项目有很多好样本。对您而言,重要的部分是控制器内部处理表单输入的方法,您可以忽略应用程序的安全性。

For more complete examples of Spring MVC form applications, the Spring Security project has a number of good samples. The important parts for you will be the methods inside the controllers that deal with form input, and you can ignore the security stuff for your application.

这篇关于将整个应用程序从简单的Java迁移到Spring MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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