通过excel生成html代码,再转为jsp代码获取后台动态数据

2 篇文章 0 订阅
1 篇文章 0 订阅
第一步:通过excel生成html代码

在这里插入图片描述文件另存为其他格式,选择htm或者html格式保存下来

第二步:通过Notepad++编辑器打开

在这里插入图片描述
右键通过编辑器打开就可以看到html代码

第三步:在你的工程目录下面新建一个jsp文件

在这里插入图片描述把编辑器的代码copy至jsp文件中,最后记得在顶部引入jsp的标签,因为我们下一步要通过后台获取动态数据

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
第四步:后台获取动态数据返回给前台
    @RequestMapping(value = "/first.htm")
    public String  countFirst(HttpServletRequest request) throws Exception{
        String sdeptCode = request.getParameter("sdeptCode");
        String smallUnitType2 = request.getParameter("smallUnitType2");
        String isSum = request.getParameter("isSum");
        List<CountDataView> list = countDataService.getBcontractFirstData(sdeptCode, smallUnitType2, isSum);
        for (CountDataView countDataView : list) {
            countDataView.setSystemType("1.1");
        }
        request.setAttribute("list", list);
        return "ims/count/first.jsp";
    }

第五步:前台遍历获取动态数据
<c:forEach items="${list}" var="CountDataView" varStatus="status">
        <tr height="28" class="xl65" style='height:14.00pt;'>
            <td class="xl72" height="28" style='height:14.00pt;' x:str>
                    ${status.index+1}
            </td>
            <td class="xl72" x:str>${CountDataView.sdeptCode}</td>
            <td class="xl72" x:str>${CountDataView.twoOrgName}</td>
            <td class="xl72" x:str>${CountDataView.threeOrgName}</td>
            <td class="xl73">${CountDataView.fourOrgName}</td>
            <td class="xl72" x:str>${CountDataView.dsLevelOrgName}</td>
            <td class="xl72" x:str>${CountDataView.tsaleOrgParentName}</td>
            <td class="xl72" x:str>${CountDataView.saleOrgTypeName}</td>
            <td class="xl72" x:str>${CountDataView.ctou}</td>
            <td class="xl72" x:str>${CountDataView.dcntrtMgmtName}</td>
            <td class="xl72" x:str>${CountDataView.cntrtMgmtUnitcd}</td>
            <td class="xl73">${CountDataView.cntrtMgmtUnitNm}</td>
            <td class="xl72" x:str>${CountDataView.smallCode}</td>
            <td class="xl72" x:str>${CountDataView.smallName}</td>
            <td class="xl72" x:str>${CountDataView.smallUnitType2}</td>
            <td class="xl72" x:str>${CountDataView.largeClassName}</td>
            <td class="xl72" x:str>${CountDataView.smallClassName}</td>
            <td class="xl72" x:str>${CountDataView.smallAssessmentId}</td>
            <td class="xl72" x:str>${CountDataView.smallAssessmentType}</td>
            <td class="xl72" x:str>${CountDataView.contractCode}</td>
            <td class="xl72" x:str>${CountDataView.signDate}</td>
            <td class="xl72" x:str>${CountDataView.endDate}</td>
            <td class="xl72" x:str>${CountDataView.contractStatus}</td>
            <td class="xl72" x:str>${CountDataView.smallCeoUserId}</td>
            <td class="xl72" x:str>${CountDataView.smallCeoName}</td>
            <td class="xl72" x:str>${CountDataView.smallCeoIdCard}</td>
            <td class="xl72" x:str>${CountDataView.smallMode}</td>
            <td class="xl73">${CountDataView.smallModeOutSub}</td>
            <td class="xl72" x:str>${CountDataView.systemType}</td>
        </tr>
    </c:forEach>
最后一步:访问试试效果

在这里插入图片描述ok!通过excel转换为jsp代码获取动态数据就到这了,希望能给有需要帮助的人,谢谢!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

情谊梦幻

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值