最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - How to Download a JSP Page as a DOC File in Spring MVC? - Stack Overflow

programmeradmin1浏览0评论

I want to provide an option to download this generated JSP page as a .doc file. How can I achieve this in Spring MVC?

<%@ page import="java.text.SimpleDateFormat, java.util.Date" %> 
    <%
        SimpleDateFormat formatter = new SimpleDateFormat("dd MMMM, yyyy");
        String currentDate  = formatter.format(new Date());
    %>
    <%@include file="/WEB-INF/views/header.jsp"%>
    <%@include file="/WEB-INF/views/datatablelibjs.jsp"%>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Portal Email Template</title>
    </head>
    <body>
        <p><strong>Subject:</strong> Application for grant of License</p>
        <p>Date: <%= currentDate %></p>
        <p>Content of the document...</p>
    </body>
    </html>

Controller

@RequestMapping(value = "/dfa1-circulation" , method = RequestMethod.GET)
public String showDfa1CirculationLetter(Model model, @RequestParam("appId") Long appId) {
    LmApplicationIl lmail = summaryService.getLmIlApplication(appId);
    model.addAttribute("lmail", lmail);
    
    List<LmApplicationItemDetailsIlBean> itemList = summaryService.getItemList(appId);
    model.addAttribute("itemList", itemList);
    
    List<IlPhashIIApplicationStatusBean> statusBeanList = ilPhashIIService.getIlPhashIIApplicationStatusList(appId);
    model.addAttribute("statusBeanList", statusBeanList);
    
    return "dfa1CirculationLetter";  
}
发布评论

评论列表(0)

  1. 暂无评论