views:

20

answers:

1

I have been working on spring-mvc for last 3 months and its been lot productive compared to my earlier work. I kept adding lot of featuers in the web application and now am stuck with the simple problem.

All the features I have added wont be used in all deployments and I need to figure out a way to exclude some features at the time of deployment. Some other deployment need different set of exclusions.

Exclusion means I want to get rid of jsps/controllers/dao/service code while deploying the application. Package structure as well as directory structure for jsps is good enough that I can separate out the part I don't want for particular deployment.

Right now I can do it manually and with some added parameters I can have ant task to do that stuff too. I want to hear about the better approaches for this problem. Considering am done with only 50% of total development I want to get rid of this problem as soon as possible. Thanks in Advance.

+1  A: 

Separate jars for the elements to be used independently? Last time I did this, the only problem I ran into was that jsps could not be used that way (easily), so I had a custom ant/maven task/goal to ensure the jsps were taken from the jars and placed in the war. So I was not excluding parts, but selecting the elements to include (I assume that is OK for you too).

But now, with OSGi, I believe you can have truly modular web applications. An intro into modular web applications with Spring and OSGi might be of interest, although it refers to the unreleased version a proper released version is available.

Fried Hoeben
thanks for the OSGI hint
Ketan Khairnar
Ketan Khairnar