简体   繁体   中英

how to send .csv read data from JSP to HTML page, through url?

I'm reading data from some .csv file & need to send that data to some HTML page through url only. My JSP file only reads data from .csv & doesn't contain any HTML tag or form. How shall I achieve it?

This is what we use to display simple reports. It's currently lacking handling of quoted fields.

  <table >
    <tbody>
      <c:set var="newLine" value="<%= \"\n\" %>" />
      <c:forEach var="row" items="${fn:split(owdata:get('csv_file'), newLine)}" varStatus="rowStatus">
        <tr>
          <c:set var="rowSpaced" value="${fn:replace(fn:replace(row, ',,', ', ,'), ',,', ', ,')}" />
          <c:choose>
            <c:when test="${fn:contains(rowSpaced, ',')}">
              <c:forEach var="cell" items="${fn:split(rowSpaced, ',')}">
                <td>${cell}</td>
              </c:forEach>
            </c:when>
            <c:otherwise>
              <td colspan="10">${rowSpaced}</td>
            </c:otherwise>
          </c:choose>
          <td colspan="100"></td>
        </tr>
      </c:forEach>
    </tbody>
  </table>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM