可以将简单的JSp和Servlet代码迁移到Spring框架吗? [英] Can a simple JSp and servlet code be migrated to Spring framework?

查看:116
本文介绍了可以将简单的JSp和Servlet代码迁移到Spring框架吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是网站开发的新手.我正在使用servlet和JSP进行Web开发.但是,最近我了解到Spring Framework非常适合包含servlet,jsp等的内容.所以,我的问题是,现在可以使用Spring框架运行程序吗?像,我有2个jsp代码和1个servlet类.那么,如何在Spring Framework中迁移代码?我还需要维护哪些其他东西或代码?

I am a newbie in web development. I'm using servlets and JSP for web development.However, I've learnt lately that Spring Framework is apt for that which incorporate servlets, jsp etc. So, my question is that can I now run my program using Spring framework ? Like, I have 2 jsp codes, and 1 servlet class. So, how can I migrate the code in Spring Framework ? what additional things or codes do I need to maintain ?

推荐答案

迁移现有的J2EE项目很容易. 您将在此过程中摆脱掉许多样板"代码.我认为最简单的方法是使用SpringToolSuite. 在STS中导入您的项目,然后向其添加"Maven"性质.在pom配置中,您可以编辑所需的所有jar,并提及spring框架.一旦完成所有这些设置,如果代码很小的话,只需几分钟即可更改代码.

Migrating an existing J2EE project is easy. You will get rid of a lot of "boilerplate" code in the process. The easiest way to do it in my opinion will be to use SpringToolSuite. Import your project in STS and then add "Maven" nature to it. In the pom configuration you can edit all the jars that you need and mention the spring framework. Once all this is setup it will be just a matter of minutes to change the code if it is small.

您可以按照以下有关maven和spring的视频教程进行学习. Java大脑

You can follow these video tutorials about maven and spring to learn about it. JavaBrains

在YouTube上,同样有更多的新圈子培训"教程.

There are more tutorials by "New Circle training" on youtube for the same.

我还建议您阅读 Spring in action 3rd Edition-Manning

这本书是学习Spring框架的必不可少的也是最好的方法.希望这会有所帮助

This book is a must and the best way to learn spring framework. Hope this helps

这篇关于可以将简单的JSp和Servlet代码迁移到Spring框架吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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