[opencms-dev] Getting file name in detail page?

Jonathan Woods jonathan.woods at scintillance.com
Tue Nov 7 08:15:25 CET 2006


Justin -

	final CmsJspActionAlement cmsJspActionElement = new
CmsJspActionElement();
	cmsJspActionElement.init(pageContext, request, response);
	final CmsObject cmsObject = cmsJspActionElement.getCmsObject();

	// What you're really interested in:

	final String requestedUri = cmsObject.getRequestContext().getUri();
	final CmsResource requestedResource =
cmsObject.readResource(requestedUri);
	final String relativeResourcePath =
cmsObject.getRequestContext().removeSiteRoot(requestedResource.getRootPath()
);

And then you can do anything you like with the value.

Jon

-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Stanczak Group
Sent: 07 November 2006 03:14
To: The OpenCms mailing list
Subject: [opencms-dev] Getting file name in detail page?

I have a jsp that's the "template-elements" for some xml content. How can I
get the name of the file that's using this as a detail? Like content loop
uses opencms.filename I want to do that same so I can check the extension to
see if it's html or xml?

--
Justin Stanczak
Stanczak Group
812-735-3600

"All that is necessary for the triumph of evil is that good men do nothing."
Edmund Burke


_______________________________________________
This mail is sent to you from the opencms-dev mailing list To change your
list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list