A major release
Despite of his version number, Play2War, the famous productive web framework:
Servlet 2.5 containers can now be used to deploy your Play applications!
Servlet 2.5 containers means Tomcat 6, Jetty 7, …
But this compatibility as a price: performances. They are worth than with Servlet 3.0, themselves worth than with native Play 2.
Two threads are indeed necessary to compute each request:
- one for handling HTTP request
- one for Akka asynchronous computing
Standard Java synchronization mecanisms (wait/notify) are then used to make theses threads work together. Of course, they are managed by threads pools, but synchronization has a cost. So if you need high performances and have to deploy WAR packages, please upgrade to a modern servlet 3.0 container, such as Tomcat 7, Jetty 8, JBoss 7.x, Glassfish 3.x (not tested yet), …
Don’t forget to look at full Changelog.
Upgrade your project’s configuration
Switching between Servlet 2.5 and 3.0 requires configuration, so you will need to upgrade to Play project to be compatible with Play2War 0.7.
Here is a typical Play2 project project/Build.scala
using Play2war v0.6:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
Follow the next steps to upgrade it to play2War v0.7.
Remove Play2War core dependency
Dependency to Plat2War core is not necessary anymore. It will be automatically setup by the plugin.
1 2 3 4 5 6 7 8 9 |
|
So, remove it.
1 2 3 4 5 6 7 8 9 |
|
Update Play2War plugin version
As usual, update project/plugin.sbt
:
1
|
|
Import Play2War SBT settings
1 2 3 |
|
Move all settings in a variable and add Play2War SBT settings to your project’s settings
1 2 3 4 5 6 7 8 9 10 11 |
|
Configure servlet container version
1 2 3 4 |
|
Final project file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
Package your application
Then, package your application as usual: sbt package
(or play package
).