即使将战争作为战争文件部署到servlet容器中,即使它大量使用JPA? [英] Deploy play as a war file into a servlet container, even if it uses JPA heavily?

查看:74
本文介绍了即使将战争作为战争文件部署到servlet容器中,即使它大量使用JPA?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个新手,实际上我现在就读有关它的内容,我该怎么说……关于问题的疑问.目前,我正在启动一个项目,该项目依赖于许多特殊的Java库(hibernate-spatial,jts等).因为它还应该实现全面的REST API,所以我不得不在Django和经典JavaEE Glassfish应用之间做出选择.

I am fairly new to play, in fact i read right at the moment about it, and what should I say...Questions over questions. At the moment I am kickstarting a project which relies on a lot of special java libraries (hibernate-spatial, jts, etc...). Because it also should implement a comprehensive REST API, I had to decide between Django versus classic JavaEE Glassfish app.

但是现在我认为在比赛中我可以两全其美,我真的很想更深入地研究它.

But now I think with play I get the best of both worlds and I really would like to dive deeper into this.

我真的无法想象,play的一个功能是将play应用作为WAR文件部署到甚至tomcat之类的简单Servlet容器中.

One feature of play, I really can't imagine, is to deploy play apps as WAR files even to a simple Servlet Container like tomcat.

是对的,如果我的播放应用程序使用基于hibernate/hibernate-spatial的JPA持久层,是否仍可以作为WAR文件部署到简单的tomcat servlet容器中?还是至少需要一个JavaEE Application Server?

So is it right, that if my play app uses a JPA persistance layer based on hibernate/hibernate-spatial still can be deployed as WAR file to a simple tomcat servlet container? Or do I need a JavaEE Application Server at least?

我不敢相信...

推荐答案

您不需要完整的Java EE服务器,甚至不需要像Tomcat这样的独立servlet容器.玩基本上是它自己的服务器!更准确地说,Play与 JBoss Netty 捆绑在一起.与Node.js具有相同的概念.如果您以前使用过Django,则概念很像:

You don't need a full Java EE server, or even a standalone servlet container like Tomcat. Play basically IS its own server! To be more precise, Play comes bundles with JBoss Netty... an embeddable Java server that uses some of the same concepts as Node.js. If you've used Django before, then the concept is a lot like:

python manage.py runserver

许多Play开发人员使用 PaaS(即云")服务,例如Heroku或AppFog.如果要部署到自己的传统专用服务器上,则需要像Tomcat一样在该计算机上安装Play框架. 此处.

Many Play developers use a PaaS (i.e. "cloud") service, such as Heroku or AppFog. If you are deploying to your own traditional dedicated server, then you install the Play framework on that machine just as you would Tomcat. The documentation for deployment goes into more detail here.

Play的第一个版本还具有一个选项,可以将您的应用程序打包为WAR文件,以便部署到传统的servlet容器中. Play 2.0放弃了此支持.它是在Play 2.1中重新发布的蓝图,但显然没有成功.

The first version of Play also had an option for packaging your application as a WAR file, for deployment to a traditional servlet container. Play 2.0 dropped this support. It was on the roadmap to come back in Play 2.1, but apparently did not make it.

我希望看到WAR文件功能得以恢复,因为大多数企业机构都在其部署基础架构上投入了大量资金,并且对快速变化持敌对态度.值得一提的是,由于使用了API,因此无论如何,Play 2.1应用程序都永远无法在Tomcat 7之前的版本上运行.

I would like to see WAR file functionality restored, because most enterprise shops are heavily invested in their deployment infrastructure, and are hostile to rapid change. It's worth mentioning that due to the API'S used, a Play 2.1 app would never run on a version of Tomcat older than 7 no matter what.

不过,Play 2.1确实能够将应用程序捆绑到可部署的ZIP文件中,类似于WAR文件.这些独立的ZIP仍然需要您在服务器上安装Play,但是它们使打包和将应用程序从一台计算机部署到另一台计算机变得更加容易.

However, Play 2.1 does have the ability to bundle up applications into deployable ZIP files, similar to WAR files. These standalone ZIP's still require that you install Play on the server, but they make it easier to package up and deploy your apps from one machine to another.

这篇关于即使将战争作为战争文件部署到servlet容器中,即使它大量使用JPA?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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