3 Replies Latest reply on Oct 30, 2009 1:09 AM by Gabriella Turek

    How to include text from a txt file? <c:import> does not work

    Gabriella Turek Newbie

      Hello, I'd like to be able to include the text from a text file which has build information in my footer.
      I've tried to use <c:import> but it's not being parsed. ie nothing shows up on the page and viewing the source the tag appears in full. No errors are generated.
      I've tried using <ui:include> but I get the message:
      com.sun.facelets.FaceletException: Error Parsing /buildnumber.txt: Error Traced[line: 1] Content is not allowed in prolog.

      My template.xml code:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      <f:view contentType="text/html"
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
          <title>Riskscape Module Repository</title>
          <link rel="shortcut icon" href="#{request.contextPath}/favicon.ico"/>
          <a:loadStyle src="resource:///stylesheet/theme.xcss"/>
          <a:loadStyle src="/stylesheet/theme.css"/>
          <ui:insert name="head"/>


          <ui:include src="menu.xhtml">
              <ui:param name="projectName" value="Riskscape Module Repository"/>

        <div class="body">
          <h:messages id="messages" globalOnly="true" styleClass="message"
              errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg"
              rendered="#{showGlobalMessages != 'false'}"/>
          <ui:insert name="body"/>

        <div class="footer">
             Build: <ui:include src="../buildnumber.txt"/>