cancel
Showing results for 
Search instead for 
Did you mean: 

How to access cmsconfig.xml file from class in WEB-INF/Classes folder

Former Member
0 Kudos

Hello All,

I need to parse <b>cmsconfig.xml</b> which is present in <b>ServletExec AS\se-LHCMS\webapps\default\Lighthammer\WEB-INF\classes</b> folder ,to get the <b>location</b> attribute of <b>webroot-directory</b> node. I created one action block for this. It works perfectly fine when I execute it on local system.

But when I upload this action block on XMII server, it is not able to find the <b>cmsconfig XML</b> file at specified relative path. Instead it tries to find the cmsconfig.xml file in C:\WINDOWS\system32 dir.

Is their any way to access this file from class present in WEB-INF/Classes dir.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

An unsupported mechanism for 11.5 would be:

import com.lighthammer.cms.system.*;

String sPath = ConfigManager.getInstance().getWebRootPath();

This will not work with 12.0, and since there really is no "web root path" in 12.0, I'd discourage you from doing anything that depends on that path.

Former Member
0 Kudos

Thanks Rick.

The solution is working fine.

We need store pdf file on the server. Initially we were doing hard coding of this path.

To avoid this hard coding we were needing a way to find wwwroot path.

As per 12.0,we change this to store pdf file to some other location.So this will not be a problem.

Please suggest in case I am wrong.

Once again thanks for your kind support.

Former Member
0 Kudos

Hi, Vishal.

In version 12.0, here is a "virtual file system" within xMII that you might be able to use to store any documents you need. One advantage of this "virtual file system" is that it is "cluster-safe". What this means is that if you are using a clustered xMII implementation (primary/secondary or load-balanced), you really don't want to ever store anything on the physical file system on only one of the server(s).

I would check with the xMII team for specific (I'm no longer with SAP).

Rick

Answers (0)