Back Forum Reply New

Multiple dispatch servlets for components

Hi,

We have a componentized system whereby we can include one or more web component.  Each component will have its ui pages, along with a component-servlet.xml.

However, when I try and include more than one, I hit a problem as they use the same extension for the mappings (*.do).  so only the last one wins.

Is there a way to include more than one component, and have the mappings quot;appendedquot; to the first components?

Currently this is what (obviously) doesn't work in web.xml.  However, is there a way to fix it that I'm missing?

lt;!-- admin component mappings --gt;
lt;servletgt;
lt;servlet-namegt;adminlt;/servlet-namegt;
lt;servlet-classgt;org..web.servlet.DispatcherSe  rvletlt;/servlet-classgt; lt;load-on-startupgt;3lt;/load-on-startupgt; lt;/servletgt;   lt;servlet-mappinggt;      lt;servlet-namegt;adminlt;/servlet-namegt;      lt;ucl-patterngt;*.dolt;/ucl-patterngt;   lt;/servlet-mappinggt;      lt;!-- script runner component mappings --gt;   lt;servletgt;     lt;servlet-namegt;scriptRunnerUIlt;/servlet-namegt;
lt;servlet-classgt;org..web.servlet.DispatcherSe  rvletlt;/servlet-classgt;     lt;load-on-startupgt;4lt;/load-on-startupgt;   lt;/servletgt;   lt;servlet-mappinggt;     lt;servlet-namegt;scriptRunnerUIlt;/servlet-namegt;     lt;ucl-patterngt;*.dolt;/ucl-patterngt;   lt;/servlet-mappinggt;
Many thanks,

David

For anyone interested, I was going about it the wrong way.  Realised I could set multiple config locations for a single mapping, AS LONG AS THE BEAN DEFINITIONS DON'T COLLIDE (last one wins).

So web.xml becomes:

lt;!-- admin component mappings --gt;
lt;servletgt;
lt;servlet-namegt;adminlt;/servlet-namegt;
lt;servlet-classgt;org..web.servlet.DispatcherSe  rvletlt;/servlet-classgt; lt;load-on-startupgt;3lt;/load-on-startupgt;   lt;init-paramgt;     lt;param-namegt;contextConfigLocationlt;/param-namegt;     lt;param-valuegt;       /WEB-INF/admin-servlet.xml,       /WEB-INF/scriptRunnerUI-servlet.xml     lt;/param-valuegt;   lt;/init-paramgt;   lt;/servletgt;   lt;servlet-mappinggt;      lt;servlet-namegt;adminlt;/servlet-namegt;      lt;ucl-patterngt;*.dolt;/ucl-patterngt;   lt;/servlet-mappinggt;
¥
Back Forum Reply New