PDA

View Full Version : Using shared Spring Webapp in Tomcat


Rapthor
Jun 14th, 2007, 03:09 AM
Hello,

I am about to finalize some early state Spring web application (just the persistence and logic part). I am using Hibernate to retrieve data from a database. I created the whole logic using the Spring framework; at the top there is a Session Facade providing access to all the services.

At this point I want to create JSP/JSF views in another webapp. I want to create a new web application that *USES* the services of the one described above. For Tomcat 6 there is a folder called "$CATALINAHOME/shared/lib" that is said to be used for that kind of stuff.

1.) Would you advice me to create a war file from my ´services webapp and put it into the lib directory? Is this the way to go?

2.) Furthermore: Where do I start with my JSP/JSF view webapp? I assume I have to access the SessionFacade somehow.

3.) Which classes/patterns should provide access to the services webapp?

4.) I guess I have to create URL mappings within the second Spring configuration xml, as well?! So the controllers are part of my JSP/JSF view webapp, too?

I'd appreciate some hints on that!
Thanks in advance!

johanr
Jun 14th, 2007, 04:35 PM
- You use a session facade: is it an EJB ? Tomcat does not support EJBs.
- Deploying a war file in any lib directory is nonsense. It contains only jar files.
- What do you mean exactly by "services webapp" ? If it is only a set of services exposed through a session bean, it is not a webapp.

I think you should instead deploy an ear file containing your different modules, and rather use JBoss for this... If you do not use EJBs, simply deploy one normal webapp...