这个是控制页面为word的代码么?

我爱LYN 发布于 2015/08/21 15:42
阅读 161
收藏 0

解读下一代网络:算力网络正从理想照进现实!>>>

<xml>
<w:WordDocument>
  <w:View>Print</w:View>
  <w:Zoom>100</w:Zoom>
  <w:Compatibility>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>

</xml>

正常来讲要打开一个页面并让其显示在word中应该是怎么写?有什么特殊要求?值得注意的是我这里并不是打开word文件,更像是编辑word文档的内容,个人目前理解到这里,望大侠相助!下面是我的完整页面代码:
<%@ page contentType="application/msword; charset=gbk" language="java"
import="com.dlgz.job.EventDTO,
com.dlgz.business.form.EventContentForm,
java.util.Date,
com.dlgz.comm.Constant,
com.dlgz.comm.Formatter,
com.dlgz.job.JobBean,
com.dlgz.job.JobDTO,
com.dlgz.conf.Configure,
com.dlgz.job.JobPageDTO,
com.dlgz.job.EventStateDTO"
%>
<%
String title = null;
EventContentForm content=new EventContentForm();
content=(EventContentForm)request.getAttribute("eventcontent");
EventDTO eventDTO = (EventDTO)session.getAttribute("eventDTO");
JobPageDTO jpageDTO = new JobBean().getPage(eventDTO.jobid,""+eventDTO.eventid,"1",1);
int dup = jpageDTO.getTpage()-jpageDTO.getFpage()+1;
dup=Formatter.getParam(request,"dup",1);
int lineHeight=Formatter.getParam(request,"lineHeight",100);
 if(eventDTO.printTitle == null || eventDTO.rootTypeid == 1)
    title = eventDTO.jobTypeName;
String date=new java.sql.Date(System.currentTimeMillis()).toString();
%>
<html xmlns:o="urn:schemas-microsoft-com🏢office"
xmlns:w="urn:schemas-microsoft-com🏢word"
xmlns="http://www.w3.org/TR/REC-html40">


<head>
<meta http-equiv=Content-Type content="text/html; charset=gb2312"><%if(Configure.DISPALY_MARK_BAR){%>
<link rel=File-List href="book_100.files/filelist.jsp?jobid=<%=eventDTO.jobid%>&markcode=<%=eventDTO.getMark()%>">
<%}%><link rel=Edit-Time-Data href="book_100.files/editdata.mso">
<title>公证书</title>
<!--[if gte mso 9]><xml>
<w:WordDocument>
<!---关键就在这里视图控制--->
  <w:View>Print</w:View>
<!------------------------>
  <w:Zoom>100</w:Zoom>
  <w:Compatibility>
   <w:UseFELayout/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->


<style>
<!--
 /* Font Definitions */
 @font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:仿宋_GB2312;
panose-1:2 1 6 9 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:1 135135232 16 0 262144 0;}
@font-face
{font-family:????;
panose-1:0 0 0 0 0 0 0 0 0 0;
mso-font-charset:0;
mso-generic-font-family:roman;
mso-font-format:other;
mso-font-pitch:auto;
mso-font-signature:0 0 0 0 0 0;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@仿宋_GB2312";
panose-1:2 1 6 9 3 1 1 1 1 1;
mso-font-charset:134;
mso-generic-font-family:modern;
mso-font-pitch:fixed;
mso-font-signature:1 135135232 16 0 262144 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:widow-orphan;
font-size:10.5pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;}
h3
{margin-top:18.0pt;
margin-right:0cm;
margin-bottom:12.0pt;
margin-left:3.0cm;
text-align:justify;
text-justify:inter-ideograph;
text-indent:-42.5pt;
mso-pagination:widow-orphan;
page-break-after:avoid;
mso-outline-level:3;
layout-grid-mode:char;
font-size:15.0pt;
font-family:"Times New Roman";
font-weight:bold;}
p.MsoToc1, li.MsoToc1, div.MsoToc1
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:widow-orphan;
layout-grid-mode:char;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;}
p.MsoHeader, li.MsoHeader, div.MsoHeader
{margin:0cm;
margin-bottom:.0001pt;
text-align:center;
mso-pagination:widow-orphan;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
border:none;
mso-border-bottom-alt:solid windowtext .75pt;
padding:0cm;
mso-padding-alt:0cm 0cm 1.0pt 0cm;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;}
p.MsoFooter, li.MsoFooter, div.MsoFooter
{margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
tab-stops:center 207.65pt right 415.3pt;
layout-grid-mode:char;
font-size:9.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;}
p
{mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:宋体;
mso-bidi-font-family:宋体;}
p.style1, li.style1, div.style1
{mso-style-name:style1;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:10.5pt;
font-family:宋体;
mso-bidi-font-family:宋体;}
p.style2, li.style2, div.style2
{mso-style-name:style2;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:27.0pt;
font-family:????;
mso-fareast-font-family:宋体;
mso-bidi-font-family:宋体;
font-weight:bold;}
p.style3, li.style3, div.style3
{mso-style-name:style3;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:19.5pt;
font-family:????;
mso-fareast-font-family:宋体;
mso-bidi-font-family:宋体;
font-weight:bold;}
p.style4, li.style4, div.style4
{mso-style-name:style4;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:18.0pt;
font-family:宋体;
mso-bidi-font-family:宋体;}
p.style5, li.style5, div.style5
{mso-style-name:style5;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
mso-pagination:widow-orphan;
font-size:18.0pt;
font-family:????;
mso-fareast-font-family:宋体;
mso-bidi-font-family:宋体;
font-weight:bold;}
p.a, li.a, div.a
{mso-style-name:a;
margin:0cm;
margin-bottom:.0001pt;
text-align:center;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:宋体;}
span.GramE
{mso-style-name:"";
mso-gram-e:yes;}
 /* Page Definitions */
 <%if(Configure.DISPALY_MARK_BAR){%>
 @page
{mso-footnote-separator:url("book_100.files/header.jsp?jobid=<%=eventDTO.jobid%>&markcode=<%=eventDTO.getMark()%>") fs;
mso-footnote-continuation-separator:url("book_100.files/header.jsp?jobid=<%=eventDTO.jobid%>&markcode=<%=eventDTO.getMark()%>") fcs;
mso-endnote-separator:url("book_100.files/header.jsp?jobid=<%=eventDTO.jobid%>&markcode=<%=eventDTO.getMark()%>") es;
mso-endnote-continuation-separator:url("book_100.files/header.jsp?jobid=<%=eventDTO.jobid%>&markcode=<%=eventDTO.getMark()%>") ecs;}
<%}%>
@page Section1
{size:595.3pt 841.9pt;
margin:23.55pt 61.5pt 72.0pt 33.15pt;
mso-header-margin:14.2pt;
mso-footer-margin:49.6pt;
<%if(Configure.DISPALY_MARK_BAR){%>
mso-header:url("book_100.files/header.jsp?jobid=<%=eventDTO.jobid%>&markcode=<%=eventDTO.getMark()%>") h1;
<%}%>
mso-paper-source:0;
layout-grid:15.6pt;}
div.Section1
{page:Section1;}
-->
</style>


</head>


<body lang=ZH-CN style='tab-interval:21.0pt;text-justify-trim:punctuation'>


<div class=Section1 style='layout-grid:15.6pt'>
<table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 width=672
 style='width:504.0pt;border-collapse:collapse;mso-padding-alt:0cm 0cm 0cm 0cm'>
 <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes;height:54.55pt'>
  <td width=48 rowspan=7 style='width:36.0pt;padding:0cm 0cm 0cm 0cm;
  height:43.35pt' valign=top>
  <%for(int i=0;i<dup;i++){%>
  <%if(eventDTO.eventid4.length()==15){%>
  <p class=MsoNormal style='layout-grid-mode:char'><span style='font-family:
  宋体'><br><br>┆<br>┆</span></p>
  <p class=MsoNormal style='layout-grid-mode:char'><span style='font-family:
  仿宋_GB2312'>
  <%=Formatter.rez(eventDTO.eventid4.substring(0,1))%><br><%=Formatter.rez(eventDTO.eventid4.substring(1,2))%><br><%=Formatter.rez(eventDTO.eventid4.substring(2,3))%><br><%=Formatter.rez(eventDTO.eventid4.substring(3,4))%><br><%=Formatter.rez(eventDTO.eventid4.substring(4,5))%><br>
  <%=Formatter.rez(eventDTO.eventid4.substring(5,6))%><br><%=Formatter.rez(eventDTO.eventid4.substring(6,7))%><br><%=Formatter.rez(eventDTO.eventid4.substring(7,8))%><br><%=Formatter.rez(eventDTO.eventid4.substring(8,9))%><br><%=Formatter.rez(eventDTO.eventid4.substring(9,10))%><br>
  <%=Formatter.rez(eventDTO.eventid4.substring(10,11))%><br><%=Formatter.rez(eventDTO.eventid4.substring(11,12))%><br><%=Formatter.rez(eventDTO.eventid4.substring(12,13))%><br><%=Formatter.rez(eventDTO.eventid4.substring(13,14))%><br><%=Formatter.rez(eventDTO.eventid4.substring(14,15))%>
  </span></p>
  <p class=MsoNormal style='layout-grid-mode:char'><span style='font-family:
  宋体'><br>┆<br>┆<br> 装<br>┆<br>┆<br>┆<br>订<br>┆<br>┆<br>┆<br>线
  <br>┆<br>┆<br><br></span></p>
  <p class=MsoNormal style='layout-grid-mode:char'><span style='font-family:
  仿宋_GB2312'>
  <%=Formatter.rez(Constant.DEPTMENT_ID.substring(0,1))%><br><%=Formatter.rez(Constant.DEPTMENT_ID.substring(1,2))%><br><%=Formatter.rez(Constant.DEPTMENT_ID.substring(2,3))%><br><%=Formatter.rez(Constant.DEPTMENT_ID.substring(3,4))%><br><%=Formatter.rez(Constant.DEPTMENT_ID.substring(4,5))%><br>
  <%=Formatter.rez(Constant.DEPTMENT_ID.substring(5,6))%><br><%=Formatter.rez(Constant.DEPTMENT_ID.substring(6,7))%><br><%=Formatter.rez(Constant.DEPTMENT_ID.substring(7,8))%><br><%=Formatter.rez(Constant.DEPTMENT_ID.substring(8,9))%><br><%=Formatter.rez(Constant.DEPTMENT_ID.substring(9,10))%><br>
  <%=Formatter.rez(Constant.DEPTMENT_ID.substring(10,11))%><br><%=Formatter.rez(Constant.DEPTMENT_ID.substring(11,12))%><br><%=Formatter.rez(Constant.DEPTMENT_ID.substring(12,13))%><br>┆<br>┆<br><br>
  </span></p>
  <%}else{%>
  <p class=MsoNormal style='layout-grid-mode:char'><span style='font-family:
  宋体'><br><br><br><br>┆<br>┆<br>┆<br>┆<br>┆<br>┆</span></p>
  <p class=MsoNormal style='layout-grid-mode:char'><span style='font-family:
  仿宋_GB2312'><%=Formatter.re(eventDTO.eventid4.substring(0,1))%><br><%=Formatter.re(eventDTO.eventid4.substring(1,2))%><br><%=Formatter.re(eventDTO.eventid4.substring(2,3))%><br><%=Formatter.re(eventDTO.eventid4.substring(3,4))%><br><%=Formatter.re(eventDTO.eventid4.substring(4,5))%></span></p>
  <p class=MsoNormal style='layout-grid-mode:char'><span style='font-family:
  宋体'>┆<br>┆<br>┆<br>┆<br>装<br>┆<br>┆<br>┆<br>订<br>┆<br>┆<br>┆<br>线
  <br>┆<br>┆<br>┆<br>┆<br>┆<br>┆</span></p>
  <%}%>
  <%}%>
  </td>
  <td width=624 valign=top style='width:468.0pt;padding:0cm 5.4pt 0cm 5.4pt;
  height:54.55pt'><!--  
  <p class=MsoNormal align=center style='text-align:center'><b><span
  style='font-size:22.0pt;mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:
  "Times New Roman";mso-hansi-font-family:"Times New Roman";letter-spacing:
  1.5pt'>公</span></b><b><span lang=EN-US style='font-size:22.0pt;mso-bidi-font-size:
  10.5pt;letter-spacing:1.5pt'><span
  style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp; </span></span></b><b><span
  style='font-size:22.0pt;mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:
  "Times New Roman";mso-hansi-font-family:"Times New Roman";letter-spacing:
  1.5pt'>证</span></b><b><span lang=EN-US style='font-size:22.0pt;mso-bidi-font-size:
  10.5pt;letter-spacing:1.5pt'><span
  style='mso-spacerun:yes'>&nbsp;&nbsp;&nbsp; </span></span></b><b><span
  style='font-size:22.0pt;mso-bidi-font-size:10.5pt;font-family:宋体;mso-ascii-font-family:
  "Times New Roman";mso-hansi-font-family:"Times New Roman";letter-spacing:
  1.5pt'>书</span></b><b><span lang=EN-US style='font-size:22.0pt;mso-bidi-font-size:
  10.5pt;letter-spacing:1.5pt'><o:p></o:p></span></b></p>
  <p class=MsoNormal align=center style='text-align:center;word-break:break-all'><span
  lang=EN-US><o:p>&nbsp;</o:p></span></p>-->
<%if(!Configure.DISPALY_MARK_BAR){%><br><br><br><%}%>
<p class=MsoNormal align=center style='text-align:center'><b><span
  style='font-size:22.0pt;font-family:宋体;letter-spacing:2cm'>&nbsp;公证书</span></b></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:1;height:69.4pt'>
  <td width=624 style='width:468.0pt;padding:0cm 5.4pt 0cm 5.4pt;height:69.4pt'>
  <p class=MsoNormal align=right style='text-align:right;word-break:break-all'><b><span
  style='font-size:16.0pt;font-family:仿宋_GB2312'><%int id = Formatter.getParam(request, "eventid", 0);EventDTO event = new JobBean().getEvent(id);%><%=id==event.eventid?event.eventid2:event.secondEventid2%></span></b></p>
  </td>
 </tr>
 <tr style='mso-yfti-irow:2;height:288.95pt'>
  <td width=624 valign=top style='width:468.0pt;padding:0cm 5.4pt 0cm 5.4pt;
  height:288.95pt'>
  <p class=MsoNormal align=left style='text-align:left;line-height:<%=lineHeight%>%;layout-grid-mode:char;word-break:break-all'><b><span lang=EN-US style='line-height:<%=lineHeight%>%;font-size:16.0pt;mso-ascii-font-family:
  仿宋_GB2312;mso-fareast-font-family:仿宋_GB2312'><%=Formatter.convertHtmlToTxt(content.getEventContent())%></span></b></p>
  </td>
 </tr>
<tr>
  <td width=600 valign=top style='width:450.0pt;padding:0cm 5.4pt 0cm 5.4pt;'>
  <p class=MsoNormal align=right style='text-align:right;layout-grid-mode:char'><b><span
  style='font-size:16.0pt;font-family:仿宋_GB2312'>
  <%=Constant.LUOKANDEPTMENT%>&nbsp;<br><br><br>
  <%=Configure.LUOKUAN_EVERNOTARY_BOOK%><br><br><br><br><br>
  <!--<%//Formatter.changeDateToChDate(event.getNigaoTime())%>-->
  <%
  event.eventStateDTOList = new JobBean().getEventStateList(event.eventid);
    for(int e=0;e<event.eventStateDTOList.size();e++){
    EventStateDTO es = (EventStateDTO)event.eventStateDTOList.get(e);
    if("审核".equals(es.stateName) && es.stateValue == 1){
    %>
    <%=Formatter.changeDateToChDate(es.doTime)%>
    <%
    }
    }
   %>
   <!--
   <%com.dlgz.job.EventStateDTO esDTO = new com.dlgz.business.BusinessBean().getEventState(event.eventid,"审核",1);%>
   <%=Formatter.changeDateToChDate(esDTO.doTime)%>
   -->
   <span style="color:#FFFFFF"></span></span></b></p>
  </td>
 </tr>
</table>


</div>


</body>


</html>


加载中
返回顶部
顶部