现在知道一个方法打印出来的方法是
<%@ page
language="java"
contentType="application/vnd.ms-excel;charset=UTF-8"
pageEncoding="UTF-8"
%> 在jsp上面加上这个可是不能让他展示的时候就弹出用excel形式察看我想让他电击excel按钮以后这个jsp上面就自动加上了contentType="application/vnd.ms-excel;charset=UTF-8" 。一般看jsp不会弹出excel提示筐
不知道这需要怎么解决阿<%@ page
language="java"
contentType="application/vnd.ms-excel;charset=UTF-8"
pageEncoding="UTF-8"
%> <%@ taglib prefix="s" uri="/struts-tags" %> <table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<th colspan="2" class="x-html-header"> </th>
<th colspan="4" class="x-html-header"> 인사소속</th>
<th colspan="4" class="x-html-header"> 생산성소속 </th>
<th width="7%" class="x-html-header"> </th>
<th width="9%" class="x-html-header"> </th>
<th width="11%" class="x-html-header"> </th>
<th width="12%" class="x-html-header"> </th>
</tr>
<tr>
<th colspan="2" class="x-html-header">구분</th>
<th width="8%" class="x-html-header">부서</th>
<th width="4%" class="x-html-header">과</th> <s:iterator value="list" status="status">
<tr>
<th colspan="2" class="x-html-cell01"> <s:property value="kind"/></th>
<th class="x-html-cell_tdC"> <s:property value="insa_dept_code"/></th>
<th class="x-html-cell_tdC"> <s:property value="insa_sect_code"/></th> </tr>
</s:iterator>
</table>
<%@ page
language="java"
contentType="application/vnd.ms-excel;charset=UTF-8"
pageEncoding="UTF-8"
%> 在jsp上面加上这个可是不能让他展示的时候就弹出用excel形式察看我想让他电击excel按钮以后这个jsp上面就自动加上了contentType="application/vnd.ms-excel;charset=UTF-8" 。一般看jsp不会弹出excel提示筐
不知道这需要怎么解决阿<%@ page
language="java"
contentType="application/vnd.ms-excel;charset=UTF-8"
pageEncoding="UTF-8"
%> <%@ taglib prefix="s" uri="/struts-tags" %> <table width="100%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<th colspan="2" class="x-html-header"> </th>
<th colspan="4" class="x-html-header"> 인사소속</th>
<th colspan="4" class="x-html-header"> 생산성소속 </th>
<th width="7%" class="x-html-header"> </th>
<th width="9%" class="x-html-header"> </th>
<th width="11%" class="x-html-header"> </th>
<th width="12%" class="x-html-header"> </th>
</tr>
<tr>
<th colspan="2" class="x-html-header">구분</th>
<th width="8%" class="x-html-header">부서</th>
<th width="4%" class="x-html-header">과</th> <s:iterator value="list" status="status">
<tr>
<th colspan="2" class="x-html-cell01"> <s:property value="kind"/></th>
<th class="x-html-cell_tdC"> <s:property value="insa_dept_code"/></th>
<th class="x-html-cell_tdC"> <s:property value="insa_sect_code"/></th> </tr>
</s:iterator>
</table>
你可以在url后面加参数,判断是否添加。