[opencms-dev] Show content of a plaint text file

Stephan Schrader zstephanz at gmail.com
Thu Jul 26 14:43:24 CEST 2018


Hi,

you need to use: <cms:resourceload />. See docs:
https://documentation.opencms.org/javadoc/tld/cms/resourceload.html

Stephan

Am Fr., 20. Juli 2018 um 12:20 Uhr schrieb Dominic Rothemel <
dominic at rothemel.de>:

> Hi there,
>
> I need a hint....
>
> I just want to show the content of a plain text file from the VFS on my
> website.
> (inside the plain text file is a XML configuration file from a software
> - but let's say it's just text (Type is "Text file")).
>
> Because it's not a valid content file with schema, I failed to use the
> file directly.
>
> So I created a document type with a VFSfileWidget and linked the plain
> text file.
> Inside the container page is the "UploadVFSfile -
> UseCaseUpload-00001.xml" document and formatter showVFSfile.jsp.
> But also with this construct I'm not able to put the content of the text
> file as a part in my website.
>
>
> <cms:contentload collector="singleFile"
> param="/CorrelationRules/CorrelatonExport.xml">
>     <cms:contentshow element="${opencms.filename}" />
> </cms:contentload>
>
> Container-page element "/CorrelationRules/UseCaseUpload-00001.xml" could
> not be rendered with formatter
> "/system/modules/test/formatters/showVFSfile.jsp".
>
> javax.servlet.ServletException: javax.servlet.jsp.JspException:
> org.opencms.xml.CmsXmlException: Resource
> "/CorrelationRules/CorrelatonExport.xml" is not of required type XML
> content.Stack trace
>
>
> Hope someone can help me.
>
> Thanks
> Dominic
>
> PS: I don't want to put the content in a text field of a content file.
> PPS: OpenCms 10.5.4
> _______________________________________________
> 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/cgi-bin/mailman/listinfo/opencms-dev
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20180726/89f3daae/attachment.htm>


More information about the opencms-dev mailing list