jsp导出的word默认打开是web视图,希望是页面视图

方法1

( velocity+java )我也遇到了这个问题,已经解决:
1 .<html xmlns:v='urn:schemas-microsoft-com:vml'xmlns:o='urn:schemas-microsoft-com:office:office'xmlns:w='urn:schemas-microsoft-com:office:word'xmlns:m='http://schemas.microsoft.com/office/2004/12/omml'xmlns='http://www.w3.org/TR/REC-html40'  xmlns='http://www.w3.org/1999/xhtml' >


2. ## 处理默认视图为 页面视图 
<!--[if gte mso 9]><xml><w:WordDocument><w:View>Print</w:View><w:TrackMoves>false</w:TrackMoves><w:TrackFormatting/><w:ValidateAgainstSchemas/><w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid><w:IgnoreMixedContent>false</w:IgnoreMixedContent><w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText><w:DoNotPromoteQF/><w:LidThemeOther>EN-US</w:LidThemeOther><w:LidThemeAsian>ZH-CN</w:LidThemeAsian><w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript><w:Compatibility><w:BreakWrappedTables/><w:SnapToGridInCell/><w:WrapTextWithPunct/><w:UseAsianBreakRules/><w:DontGrowAutofit/><w:SplitPgBreakAndParaMark/><w:DontVertAlignCellWithSp/><w:DontBreakConstrainedForcedTables/><w:DontVertAlignInTxbx/><w:Word11KerningPairs/><w:CachedColBalance/><w:UseFELayout/></w:Compatibility><w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel><m:mathPr><m:mathFont m:val="Cambria Math"/><m:brkBin m:val="before"/><m:brkBinSub m:val="--"/><m:smallFrac m:val="off"/><m:dispDef/><m:lMargin m:val="0"/> <m:rMargin m:val="0"/><m:defJc m:val="centerGroup"/><m:wrapIndent m:val="1440"/><m:intLim m:val="subSup"/><m:naryLim m:val="undOvr"/></m:mathPr></w:WordDocument></xml><![endif]-->
## 处理默认视图为 页面视图 

来源:http://bbs.csdn.net/topics/390734012

 

方法2

<!--[if gte mso 9]>  

  <xml>  

 <w:WordDocument>  

      <w:View>Print</w:View>  

      <w:DoNotOptimizeForBrowser/>  

      <w:Compatibility>  

        <w:DontGrowAutofit/>  

      </w:Compatibility>  

    </w:WordDocument>  

  </xml>  

<![endif]--> 

替换原jsp中的<head>中<!--[if gte mso 9]>  开头的代码

来源:http://blog.csdn.net/coolwubo/article/details/39530229

posted @ 2017-04-06 11:13  爱吐泡泡的小小鱼  阅读(1335)  评论(1编辑  收藏  举报