You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Tóth Csaba <ig...@domen.hu> on 2018/04/19 10:44:19 UTC
CXF service config file from multiple location with conditions
Hello!
I'd like some config loading with conditionals: I'd like to put the
config outside the war/webapp directory (the tomcat running in
autodeploy mode, and dont have rights to change it).
I'd like, the cxf search the config file in the location1, and if not
found in the location2, and until there is an element in the location
list, or found the config file.
this is possible? or what component need to change for it?
Thanx.
Csaba
Re: CXF service config file from multiple location with conditions
Posted by vEnkaTa mohAna rAo SriperumbUdUru <mo...@gmail.com>.
In my opinion you can do that, override the class CXFServlet class and
override the method load bus especially the following logic.
String configLocation = servletConfig.getInitParameter("config-location");
if (configLocation == null) {
try {
InputStream is =
servletConfig.getServletContext().getResourceAsStream("/WEB-INF/cxf-servlet.xml");
//this is default location
if (is != null && is.available() > 0) {
is.close();
configLocation = "/WEB-INF/cxf-servlet.xml";
}
} catch (Exception ex) {
//ignore
}
}
On Thu, Apr 19, 2018 at 12:44 PM, Tóth Csaba <ig...@domen.hu> wrote:
> Hello!
>
> I'd like some config loading with conditionals: I'd like to put the
> config outside the war/webapp directory (the tomcat running in
> autodeploy mode, and dont have rights to change it).
> I'd like, the cxf search the config file in the location1, and if not
> found in the location2, and until there is an element in the location
> list, or found the config file.
> this is possible? or what component need to change for it?
>
> Thanx.
>
> Csaba
>
>