Java 如何在我的GSP中显示MIME内容

Java 如何在我的GSP中显示MIME内容,java,email,grails,jakarta-mail,grails-plugin,Java,Email,Grails,Jakarta Mail,Grails Plugin,我在看邮件 除非我尝试阅读带有MIME内容的邮件,否则一切正常 这是我显示邮件内容的方式 <table> <tr> <td> ${emailInstance.body} </td> </tr> </table> ${emailInstance.body} 这就是它的显示方式 This is a multi-part message in MIME format. ----------

我在看邮件

除非我尝试阅读带有MIME内容的邮件,否则一切正常

这是我显示邮件内容的方式

<table>
  <tr>
    <td>
      ${emailInstance.body}
    </td>
  </tr>
</table>

${emailInstance.body}
这就是它的显示方式

This is a multi-part message in MIME format. --------------050707070509090302050506 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit --------------050707070509090302050506 Content-Type: message/rfc822; name="MSTD Status 20th Mar 2014 @08:00 PM EST: =?windows-1252?Q?Martinsburg=97G?==?windows-1252?Q?reen/Portland=97Green/Goodyear=97Green=2Eeml?=" Content-Disposition: inline; filename*0*=windows-1252''%4D%53%54%44%20%53%74%61%74%75%73%20%32%30%74%68; filename*1*=%20%4D%61%72%20%32%30%31%34%20%40%30%38%3A%30%30%20%50%4D%20; filename*2*=%45%53%54%3A%20%4D%61%72%74%69%6E%73%62%75%72%67%97%47%72%65; filename*3*=%65%6E%2F%50%6F%72%74%6C%61%6E%64%97%47%72%65%65%6E%2F%47%6F; filename*4*=%6F%64%79%65%61%72%97%47%72%65%65%6E%2E%65%6D%6C Content-Transfer-Encoding: 7bit X-Mozilla-Keys: Message-ID: <532B80F4.1090401@spi.com> Date: Fri, 21 Mar 2014 05:29:48 +0530 From: Hussain Akhtar Wahid User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: sivaraman.mattipalli@macys.com, saravana.elayaperumal@macys.com, venkat.davuluri@macys.com, vani.rao@macys.net CC: d2csupport@spi.com, SPI_D2C_WMS_SUPPORT@MACYS.com Subject: =?windows-1252?Q?MSTD_Status_20th_Mar_2014_=4008=3A00_?= =?windows-1252?Q?PM_EST=3A_Martinsburg=97Green/Portland=97Green/Good?= =?windows-1252?Q?year=97Green?= Content-Type: multipart/alternative; boundary="------------050503030807080405060907" This is a multi-part message in MIME format. --------------050503030807080405060907 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Hi All, Please find the MST Dashboard for D2C Applications on 20th March 2014. Notes: A. This dashboard is of 08:00PM EST. B. Martinsburg , Portland and Goodyear status are listed on the dashboard. Thanks and regards , Hussain A W . --------------050503030807080405060907 Content-Type: multipart/related; boundary="------------030304090406050502010103" --------------030304090406050502010103 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi All,
这是MIME格式的多部分消息--------------05070705050506内容类型:文本/普通;字符集=windows-1252;格式=流式内容传输编码:7bit-----------------050707070505050506内容类型:message/rfc822;name=“MSTD状态2014年3月20日美国东部时间晚上8:00时:=?windows-1252?Q?Martinsburg=97G?=?windows-1252?Q?绿色/波特兰=97Green/Goodyear=97Green=2Eeml?=”内容配置:内联;文件名*0*=windows-1252'%4D%53%54%44%20%53%74%61%74%75%73%20%32%30%74%68;文件名*1*=%20%4D%61%72%20%32%30%31%34%20%40%30%38%3A%30%30%20%50%4D%20;文件名*2*=%45%53%54%3A%20%4D%61%72%74%69%6E%73%62%75%72%67%97%47%72%65;文件名*3*=%65%6E%2F%50%6F%72%74%6C%61%6E%64%97%47%72%65%6E%2F%47%6F;filename*4*=%6F%64%79%65%61%72%97%47%72%65%6E%2E%65%6D%6C内容传输编码:7bit X-Mozilla-Keys:Message ID:Date:Fri,2014年3月21日05:29:48+0530 From:Hussain Akhtar Wahid用户代理:Thunderbird 2.0.0.9(Windows/20071031)MIME版本:1.0至:sivaraman。mattipalli@macys.com,萨拉瓦纳。elayaperumal@macys.com,文卡特。davuluri@macys.com瓦尼。rao@macys.net复写的副本:d2csupport@spi.com,SPI_D2C_WMS_SUPPORT@MACYS.com主题:=?windows-1252?Q?MSTD_Status_20_Maru_2014_=4008=3A00?=?windows-1252?Q?PM_EST=3A_Martinsburg=97Green/Portland=97Green/Good?=?windows-1252?Q?year=97Green?=内容类型:多部分/备选方案;boundary=“-----------0505030807080405060907”这是MIME格式的多部分消息--------------0505030807080405060907内容类型:文本/普通;字符集=windows-1252;格式=流动内容传输编码:7bit Hi All,请在2014年3月20日找到D2C应用程序的MST仪表板。注:A.此仪表板为美国东部时间晚上8:00。B.仪表板上列出了马丁斯堡、波特兰和固特异状态。谢谢和问候,侯赛因--------------0505030807080405060907内容类型:多部分/相关;boundary=“------0303040904060502010103”-------0303040904060502010103内容类型:text/html;charset=windows-1252内容传输编码:引用可打印Hi All,
但它应该像这样展示


您是否已在Grails Config.groovy`文件中设置了所需的所有内容。请确保:

grails.mime.types = [ html: ['text/html','application/xhtml+xml'],
                      xml: ['text/xml', 'application/xml'],
                      text: 'text/plain',
                      js: 'text/javascript',
                      rss: 'application/rss+xml',
                      atom: 'application/atom+xml',    
                      css: 'text/css',
                      csv: 'text/csv',
                      all: '*/*',
                      json: ['application/json','text/json'],
                      form: 'application/x-www-form-urlencoded',
                      multipartForm: 'multipart/form-data',
                      multipartForm: 'multipart/alternative', //in your case
                                             add other MIME types as nessary
                      manifest: 'text/cache-manifest' 
   ]        
并尝试将其添加到web.xml上

<mime-mapping>
    <extension>manifest</extension>
    <mime-type>text/cache-manifest</mime-type>
</mime-mapping>

显示
文本/缓存清单
快速查看