Using Spring as Framework, if i need provide business logic’s service to either JSP/Servlets(on Web Servers) or to Application desktop client or Mobile clients, the only way to accomplish the logic business(without EJB) in a remote server is through Servlets?
Using Spring as Framework, if i need provide business logic’s service to either JSP/Servlets(on
Share
It’s one alternative. But nothing stops you from creating your own server or handle the work to the Spring container.
The advantages with using a Servlet container is that you get thread and socket handling for free.
(This also applies to RMI with a RMI server)
The advantages with using a Web Service framework that uses a Servlet is that you only need to handle and configure generated code. And that it works with all major technologies such as .NET and PHP, since it’s just XML.
Another advantage in advanced operations environment is that a Servlet sends HTTP messages by default on port 80. With rigid firewalls, this is the absolute easiest solution.
For example with RMI, you need two ports for communication.
If you are interested in using a web container like Tomcat on your remote server, you should have the Spring container inside the web container.
But the absolute simplest alternative if you can live with Spring in both ends is to use Spring invokers together with Java 6’s bundled web container.
With good layering, you can test all the business and integration layer code with JUnit tests! That’s quite elegant!