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

Stanczak Group justin at stanczakgroup.com
Tue Nov 7 14:44:32 CET 2006


Works great, thanks.

Jonathan Woods wrote:
> 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
>
>
>
> _______________________________________________
> 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
>
>   

-- 
Justin Stanczak
Stanczak Group
812-735-3600

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




More information about the opencms-dev mailing list