- This topic has 3 replies, 2 voices, and was last updated 13 years, 4 months ago by
Greg Soulsby.
-
AuthorPosts
-
Greg SoulsbyMemberFinally I have restful web services working. An Object of a particular Class is passed back and forth, Working great, love the structure it gives. Great.
I do have a small worry however – the Class has to be defined at both ends. So I find myself copy and pasting the Class between the web apps.
Is there a way to have share one definition of a class across multiple web apps? I can see a day lost in the future due to a bug which is simply the 2 versions of the class getting out of synch accidentally.
support-swapnaModeratorP0rridge ,
You can create a new project with common code and set the project as dependent project to other projects which need it.
Here is a tutorial which explains on how to work with dependent projects in Web and EAR projects :
http://www.myeclipseide.com/documentation/quickstarts/webprojects/#advanced_features
http://www.myeclipseide.com/documentation/quickstarts/earprojects/#advanced_featuresLet us know if how it helps you.
Greg SoulsbyMemberOk, I have started that, have Parent project link to Child projects. This is giving access to the Parent classes in Child project.
When I scaffolded the Child project, I deselected all the library classes at the point were it asks if they should be copied in or you want to refer to the MyEclipse version – I hoped they would be picked up from the parent project when I made the dependency. But that is not happening – getting not found on something like
import org.springframework.dao.DataAccessException;
I can add the /lib of the parent into the classpath of the child project by hand, but I fear that would break once we build the war files and deploy?
Can I use in Parent /lib/* in the Child project in a way that wont break when deployed?
Greg
Greg SoulsbyMemberActually, I over estimated even my simplest capabilities
I cant link from the child to the /lib in the parent. Or the classes required for things like DataAccessException are not in /lib.
In researching this I came across EAR projects – would one of those as the Parent help?
-
AuthorPosts