1、jsp 导入excel
<%@page import="com.mycim.core.util.StringUtils"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page language="java"%>
<%@ taglib uri="struts-html" prefix="html"%>
<%@ taglib uri="struts-logic" prefix="logic"%>
<%@ taglib uri="struts-bean" prefix="bean"%>
<%@ taglib uri="mycim2" prefix="mycim2"%>
<html>
<head>
<title>Lot End Time</title>
<html:base />
<link rel="stylesheet" href="<%=request.getContextPath()%>/stylesheet/mycim2.css?version=${version}" type="text/css">
<script language="JavaScript" src="<%=request.getContextPath()%>/assets/js/jquery/jquery-1.11.3.js?version=${version}"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/function/function.js?version=${version}"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/function/reasoncode.js?version=${version}"></script>
</head>
<body>
<html:form action="/lotstependtime.do" styleId="endtimeForm" enctype="multipart/form-data">
<input name="impLotStepEndTimesJsonStr" type="hidden" value="${impLotStepEndTimesJsonStr}" >
<input name="errorMsg" type="hidden" value="${errorMsg}" >
<table width="800px">
<tr><td><div class="mytitle"><mycim2:contentDisplay id='LBS_LOT_ENDTIME' default='Lot End Time'/></div></td></tr>
<tr><td> </td></tr>
<tr>
<td>
<table width="100%" class="mytable">
<tr>
<td bgcolor="#E8E8E8" >
<fieldset id="fld1"><legend><mycim2:contentDisplay id="LBS_LOT_INFO" default="Lot Info"/></legend>
<table width="100%" border="0" >
<tr class="myfield">
<td width="120px" nowrap><mycim2:contentDisplay id="LBL_LOT_ID" default="Lot ID" /></td>
<td>
<html:text property="lotId" readonly="false" styleClass="myfield" size="32"/>
<mycim2:doSearch focus="lotId" type="LOT" callback='searchSubmit()'/>
</td>
<td width="120px" class="myfield" nowrap align=left>
<mycim2:contentDisplay id="LBL_CARRIER_ID" default="Carrier Id" />
</td>
<td class="myfield">
<html:text property="carrierId" readonly="false" styleClass="myfield" size="32"/>
<mycim2:doSearch focus="carrierId|lotId" type="LOT_CARRIER" callback='searchSubmit()' />
</td>
</tr>
</table>
</fieldset>
<br>
<!-- Import Excel -->
<fieldset id="fld2">
<legend>
<mycim2:contentDisplay id="LBL_DATA_IMPORT" default="Data Import" />
</legend>
<table width="100%">
<tr nowrap>
<td nowrap>
<html:file property="formFile" />
<input type="button" name="import" value="<mycim2:contentDisplay id="LBL_IMPORT" default="Import"/>" onclick = "verifyAndSubmitImport()">
</td>
<td class="myfield" bgcolor="#E8E8E8" align="left">
<a href="<%=request.getContextPath()%>/wip/endtime_import_template-version 1.xls"><mycim2:contentDisplay id="LBS_IMPORT_TEMPLATE" default="Import Template Download" /></a>
</td>
</tr>
</table>
</fieldset>
<fieldset id="fld3"><legend><mycim2:contentDisplay id="LBS_LOT_ENDTIME_LIST" default="Lot End Time List" /></legend>
<table width="100%">
<thead>
<tr align="center" class="myinnertable">
<td nowrap width="5%"><mycim2:contentDisplay id="LBL_LOT_ID" default="Lot ID" /></td>
<td nowrap width="5%"><mycim2:contentDisplay id="LBL_PROCESS_ID" default="Process ID" /></td>
<td nowrap width="5%"><mycim2:contentDisplay id="LBL_ROUTE_SEQ" default="Route Seq." /></td>
<td nowrap width="5%"><mycim2:contentDisplay id="LBL_ROUTE_ID" default="Route ID"/></td>
<td nowrap width="5%"><mycim2:contentDisplay id="LBL_OPERATION_SEQ" default="Step Seq." /></td>
<td nowrap width="5%"><mycim2:contentDisplay id="LBL_OPERATION_ID" default="Step ID"/></td>
<td nowrap width="5%"><mycim2:contentDisplay id="LBL_END_TIME" default="End Time"/></td>
<td nowrap width="15%"><mycim2:contentDisplay id="LBL_COMMENTS" default="Comments"/></td>
<td nowrap width="5%"><mycim2:contentDisplay id="LBS_SET_BY" default="Set By"/></td>
<td nowrap width="5%"><mycim2:contentDisplay id="LBS_SET_DATE" default="Set Date"/></td>
<td nowrap width="5%"></td>
</tr>
</thead>
<tbody>
<logic:present name="lotStepEndTimeList">
<logic:iterate id="item" name="lotStepEndTimeList" indexId="seq">
<tr class="myinnertable2">
<td nowrap class="myfield"><mycim2:write name="item" property="lotId" filter="true"/></td>
<td nowrap class="myfield"><mycim2:write name="item" property="processId" filter="true"/></td>
<td nowrap class="myfield"><mycim2:write name="item" property="routeSeq" filter="true"/></td>
<td nowrap class="myfield"><mycim2:write name="item" property="routeId" filter="true"/></td>
<td nowrap class="myfield"><mycim2:write name="item" property="operationSeq" filter="true"/></td>
<td nowrap class="myfield"><mycim2:write name="item" property="operationId" filter="true"/></td>
<td nowrap class="myfield"><mycim2:write name="item" property="endTime" filter="true"/></td>
<td width="15%" class="myfield"><mycim2:write name="item" property="comments" filter="true"/></td>
<td class="myfield" ><mycim2:write name="item" property="createUser" filter="true"/></td>
<td class="myfield" ><mycim2:write name="item" property="createTime" filter="true"/></td>
<td class="myfield" ><a href="javascript:doDelete('delete=Y&lotRrn=<mycim2:write name="item" property="lotRrn" filter="true"/>&endTimeRrn=<mycim2:write name="item" property="endTimeRrn" filter="true"/>')">
<img height=16 src="<%=request.getContextPath()%>/img/delete.gif" width=16 border=0></a></td>
</tr>
</logic:iterate>
</logic:present>
</tbody>
</table>
</fieldset>
<FIELDSET><LEGEND><mycim2:contentDisplay id="LBS_LOT_ENDTIME_INFO" default="Lot End Time Info"/></LEGEND>
<table width="100%">
<tr>
<td class="myfield" width="120px" nowrap>
<mycim2:contentDisplay id="LBL_PRODUCT_ID" default="Product Id"/>
</td>
<td nowrap>
<html:text property="productId" size="32" styleClass="mylongreadonly" readonly="true" />
</td>
<td class="myfield" width="120px" nowrap>
<mycim2:contentDisplay id="LBL_PROCESS_ID" default="Process Id"/>
</td>
<td nowrap>
<html:text property="processId" size="32" styleClass="mylongreadonly" readonly="true" />
<html:hidden property="processRrn"/>
</td>
</tr>
<tr class="myfield">
<td nowrap width="120px"><mycim2:contentDisplay id="LBL_ROUTE_ID" default="Route ID"/></td>
<td>
<html:text property="routeId" size="28" styleClass="myreadonly" readonly="true"/>
</td>
<td nowrap width="120px"><mycim2:contentDisplay id="LBL_OPERATION_ID" default="Operation ID"/></td>
<td>
<html:text property="operationId" size="32" />
<a href="javascript:doOpen('wip/showprocess.jsp?type=TREE_WITH_REWORK&processrrn=${lotStepEndTimeForm.processRrn}&productId=${lotStepEndTimeForm.productId}&processver=${lotStepEndTimeForm.processVersion}&executionRrn=0&routeid=routeId&oprid=operationId&returnid=returnStepNumber&routeSeq=routeSeq&operationSeq=operationSeq')">
<img height=16 src="<%=request.getContextPath()%>/img/search.gif" width=16 border=0></a>
<html:hidden property="returnStepNumber"/>
</td>
</tr>
<tr class="myfield">
<td nowrap width="120px"><mycim2:contentDisplay default="Route Seq" id="LBL_ROUTE_SEQ"/></td>
<td>
<input type="text" class="myreadonly" readonly="true" size="32" name="routeSeq" value="">
</td>
<td nowrap width="120px"><mycim2:contentDisplay default="Operation Seq" id="LBL_OPERATION_SEQ"/></td>
<td>
<input type="text" class="myreadonly" readonly="true" size="32" name="operationSeq" value="">
<input type="button" name="clear" style="margin-left:-3px;width:49px;" value="<mycim2:contentDisplay id="LBS_CLEAR" default="Clear"/>" onClick="doClean();">
</td>
</tr>
<%-- <tr class="myfield">
<td nowrap width="120px"><mycim2:contentDisplay id="LBL_DEPARTMENT_ID" default="Dept ID"/></td>
<td>
<mycim2:select property="department" styleClass="myselect3" onchange="getUsers()">
<mycim2:option type="department" default="" optionalFlag="Y"/>
</mycim2:select>
</td>
<td width="120px"><mycim2:contentDisplay id="LBL_EXT_ID" default="Ext No."/></td>
<td><html:text property="deptExt" size="32" maxlength="32"/></td>
</tr> --%>
<tr>
<%--
<td width="120px"><mycim2:contentDisplay id="LBL_RESPONSIBILITY" default="Responsibility"/></td>
<td>
<mycim2:select property="userId" styleClass="myselect3">
<%String type="ALL_USER|"+((Long)session.getAttribute("facility")).longValue();%>
<mycim2:option type="<%=type%>" default=""/>
</mycim2:select>
<!-- <input type="hidden" id="userRrn" name="userRrn"> -->
</td>
--%>
<td width="120px"><mycim2:contentDisplay id="LBL_END_TIME" default="End Time"/></td>
<td><html:text property="endTime" size="32" maxlength="32"/></td>
</tr>
<tr class="myfield">
<td width="120px"><mycim2:contentDisplay id="LBL_COMMENTS" default="Comments"/></td>
<td colspan="3">
<html:text property="comments" size="86" maxlength="256"/>
<input type="button" value="<mycim2:contentDisplay id="LBS_ADD" default="Add"/>" name="addmember" onclick="javascript:addMember();">
</td>
</tr>
</table>
</fieldset>
<br>
<table width="100%">
<tr>
<td>
<div align="center">
<input type="button" name="Reset" value="<mycim2:contentDisplay id="LBS_RESET" default="Reset"/>" onClick="goToURL('self', doSearchUrl+'&nav=true')">
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</html:form>
</body>
</html>
<script type="text/javascript">
var doSearchUrl = '<%=request.getContextPath()%>/lotstependtime.do?edit=1';
var doCarrierSearchUrl = doSearchUrl+'&byCarrierId=1';
window.CN0EN = '<%=(String)session.getAttribute("language")%>';
$(function(){
setDefault();
enterSubmitInit('lotId');
enterSubmitInit4Carrier('carrierId', doCarrierSearchUrl);
$("input[name='endTime']").focusout(validateEndTime);
var errorMsg = $("input[name='errorMsg']").val();
if($.trim(errorMsg).length>0){
alert(errorMsg);
}
});
function addMember(){
if(validateSelect()){
$("input[type='button']").attr("disabled",true);
$.ajax({
cache:false,
url:"<%=request.getContextPath()%>/lotstependtime.do?addmember=1&addType=init",
data:$('#endtimeForm').serialize(),
type: "POST",
dataType: "json",
error: function(request) {
alert("Connection error");
$("input[type='button']").attr("disabled",false);
searchSubmit();
},
success: function(data) {
if(data.success){
if(data.msg.existQty == 0){
searchSubmit();
}else if(data.msg.existQty>0){
var msg = data.msg.promptMsg;
if(window.CN0EN =="EN"){
msg += "\nConfirm to cover it?";
}else{
msg += "\n确认要覆盖?";
}
if(confirm(msg)){
coverAdd();
}else{
searchSubmit();
}
}
}else{
alert(data.msg);
}
$("input[type='button']").attr("disabled",false);
}
});
};
}
function coverAdd(){
addMemberAction("cover");
}
function addMemberAction(addType){
$("input[type='button']").attr("disabled",true);
$.ajax({
cache:false,
url:"<%=request.getContextPath()%>/lotstependtime.do?addmember=1&addType="+addType,
data:$('#endtimeForm').serialize(),
type: "POST",
dataType: "json",
error: function(request) {
alert("Connection error");
$("input[type='button']").attr("disabled",false);
searchSubmit();
},
success: function(data) {
if(data.success){
searchSubmit();
}else{
alert(data.msg);
}
$("input[type='button']").attr("disabled",false);
}
});
}
function setDefault(){
$("input[name='routeId']").val("");
$("input[name='operationId']").val("");
$("input[name='routeSeq']").val("");
$("input[name='operationSeq']").val("");
/* $("select[name='department']").val("");
$("input[name='deptExt']").val("");
$("select[name='userId']").val("");*/
}
function doClean(){//清除stepId以外的信息
$("input[name='routeId']").val("");
$("input[name='routeSeq']").val("");
$("input[name='operationSeq']").val("");
}
function validateEndTime(){
var endTime = $.trim($("input[name='endTime']").val());
if(endTime.length>0){
if(!IsNumeric(endTime)){
if(window.CN0EN == "EN"){
alert(" The end time can only be a number\n");
}else{
alert("结束时间只能是数字\n");
}
$("input[name='endTime']").val("");
}else if(!isHaveTwoDecimalsAtMost(endTime)){
if(window.CN0EN == "EN"){
alert("Endtime can only have two decimals at most!\n");
}else{
alert("Endtime最多允许有两位小数!\n");
}
if(endTime.indexOf(".")>0){//自动四舍五入,保留两位有效数字
$("input[name='endTime']").val(Math.round(parseFloat(endTime)*100)/100);
}
}
}
}
function isHaveTwoDecimalsAtMost(num){//判断是否是最多只有两位小数的数字
var reg = new RegExp ("^(-?\\d+)(\\.\\d{0,2})?$") ;
return reg.test(num);
}
function validateSelect(){
var msg="";
if($.trim($("input[name='operationId']").val()).length<1) {
if(window.CN0EN == "EN"){
msg+="The step ID cannot be empty\n";
}else{
msg+="步骤号不能为空\n";
}
}
var endTime = $.trim($("input[name='endTime']").val());
if(endTime.length<1) {
if(window.CN0EN == "EN"){
msg+="The end time cannot be empty\n";
}else{
msg+="结束时间不能为空\n";
}
}else if(!IsNumeric(endTime)){
if(window.CN0EN == "EN"){
msg+=" The end time can only be a number\n";
}else{
msg+="结束时间只能是数字\n";
}
}else if(!isHaveTwoDecimalsAtMost(endTime)){
if(window.CN0EN == "EN"){
msg+= "Endtime can only have two decimals at most!\n";
}else{
msg+= "Endtime最多允许有两位小数!\n";
}
}
if(msg.length>0){
alert(msg);
return false;
}
return true;
}
function doDelete(url){
var confirmMsg = (window.CN0EN =="EN") ? "Confirm deletion ?" : "是否确定删除?";
if(confirm(confirmMsg)){
javascript:doSubmit('<%=request.getContextPath()%>/lotstependtime.do?'+url,'1');
}
}
function verifyAndSubmitImport () {
var fileName = $("input[name='formFile']").val();
var suffix = fileName.substring(fileName.length - 4);
if (suffix != '.xls' ) {
if(window.CN0EN =="EN"){
alert("Only file with .xls extension can be imported !");
}else{
alert("只能导入xls后缀的文件!");
}
} else {
var theform = document.forms[0];
theform.action = '<%=request.getContextPath()%>/lotstependtime.do'+'?import=1';
theform.submit();
}
}
//-----------function for cascade-----------------
<%-- function getUsers(){
var s=document.getElementsByName("department")[0];
var deptId=s.options[s.options.selectedIndex].value;
var url="<%=request.getContextPath()%>/ajaxflush.do?dept="+deptId;
ajaxapp1(url);
}
function getTel(){
var s1=document.getElementsByName("department")[0];
var deptId=s1.options[s1.options.selectedIndex].value;
var s2=document.getElementsByName("userId")[0];
document.getElementById("userRrn").value=s2.value;
var userName=s2.options[s2.options.selectedIndex].value;
var url="<%=request.getContextPath()%>/ajaxflush.do?dept="+deptId+"&user="+userName;
ajaxapp2(url);
}
function ajaxapp2(url){
var xmlHttp;
xmlHttp=initAjax();
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
var t=document.getElementsByName('deptExt')[0];
var text=xmlHttp.responseText;
t.value=text;
}
}
}
//由于ie的缓存,在请求一次服务器后,如果再次请求的url与上一次相同,
//ie会直接调用缓存,而不请求服务器。所以要给链接加一个时间戳。
url=convertURL(url);
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function ajaxapp1(url){
var xmlHttp;
xmlHttp=initAjax();
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200){
var select=document.getElementsByName('userId')[0];
var text=xmlHttp.responseXML;
var t=document.getElementsByName('deptExt')[0];
t.value="";
addOptions(select,text);
}
}
}
//由于ie的缓存,在请求一次服务器后,如果再次请求的url与上一次相同,
//ie会直接调用缓存,而不请求服务器。所以要给链接加一个时间戳。
url=convertURL(url);
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
//初始化xmlhttprequest
function initAjax(){
var xmlHttp;
if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
} else if (window.ActiveXObject) {
if(window.CN0EN == "EN"){
alert("Your browser is not IE , this feature may not be displayed properly");
}else{
alert("非IE浏览器,该功能可能无法正常显示!");
}
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlHttp;
}
// select表示<select>对象,xml表示XMLDocument对象
function addOptions(select, xml)
{
if(select)
{
var options = "";
var cn=xml.childNodes[0];
for(var i = 0; i < cn.childNodes.length ; i++)
{
if(cn.childNodes[i].nodeName == "list")
{
var s = "";
s = cn.childNodes[i].text;
s=s!=undefined?s:cn.childNodes[i].textContent;
var index=s.indexOf("|");
var s1=s.substring(0,index);
var s2=s.substring(index+1,s.length)
options += "<option value='" + s2 + "'>" ;
options += s1;
options += "</option>"
}
}
var name = select.name;
select.outerHTML = "<select name='" + name + "' onchange='getTel()'>" + options + "</select>";
}
}
//给链接加时间戳
function convertURL(url) {
var timstamp = (new Date()).valueOf();
if (url.indexOf("?") >= 0) {
url = url + "&t=" + timstamp;
} else {
url = url + "?t=" + timstamp;
}
return url;
} --%>
//-----------end-----------------
</script>
2、翻页按钮
<br>
<input type="hidden" name="curPage" value="${page.pageNo }" />
<input type="hidden" name="view" value="" />
<script type="text/javascript">
function page(val) {
$('input[name="curPage"]').val(val);
$('input[name="view"]').val("1");
}
</script>
<!-- 翻页工具 -->
<table width="100%" border="0">
<tr>
<div align="right">
<!-- 首页 -->
<logic:equal value="true" name="page" property="firstPage">
<input type="button" value=" << " disabled="disabled" />
</logic:equal>
<logic:notEqual value="true" name="page" property="firstPage">
<input type="submit" value=" << " name="search" onClick="javascript:page(1);OpenLoadingDiv();"/">
</logic:notEqual>
<!-- 上一页 -->
<logic:equal value="true" name="page" property="hasPrePage">
<input type="submit" value=" < " name="search" onClick="page(${page.prePage});OpenLoadingDiv();"/">
</logic:equal>
<logic:notEqual value="true" name="page" property="hasPrePage">
<input type="button" value=" < " disabled="disabled" />
</logic:notEqual>
<!-- 下一页 -->
<logic:equal value="true" name="page" property="hasNextPage">
<logic:notEqual value="${page.lastPage}" name="page" property="pageNo">
<input type="submit" value=" > " name="search" onClick="page(${page.nextPage});OpenLoadingDiv();"/">
</logic:notEqual>
</logic:equal>
<logic:notEqual value="true" name="page" property="hasNextPage">
<logic:notEqual value="${page.lastPage}" name="page" property="pageNo">
<input type="button" value=" > " disabled="disabled" />
</logic:notEqual>
</logic:notEqual>
<!-- 尾页 -->
<logic:greaterThan value="0" name="page" property="totalPages">
<logic:equal value="false" name="page" property="lastPage">
<input type="submit" value=" >> " name="search" onClick="page(${page.totalPages});OpenLoadingDiv();"/">
</logic:equal>
</logic:greaterThan>
<logic:equal value="0" name="page" property="totalPages">
<input type="button" value=" >> " disabled="disabled" />
</logic:equal>
<logic:equal value="true" name="page" property="lastPage">
<input type="button" value=" >> " disabled="disabled" />
</logic:equal>
</div>
</tr>
</table>
后台
private ActionForward view(HttpServletRequest request, HttpServletResponse response, QueryUnitForm theform,
ActionMapping mapping) throws Exception {
Map qryConditions = getQryConditions(request, theform);
int curPage = WebUtil.getParameterInt("curPage", request);
Page unitPage = new Page(curPage, PAGESIZE);
unitPage = getUnitManager().qryUnitTransReason(unitPage, qryConditions);
handleData(unitPage, request);
request.setAttribute("page", unitPage);
return mapping.findForward("view");
}
logic:iterate
<fieldset id="fld1"><legend><mycim2:contentDisplay id="" default="详细信息"/></legend>
<table width="100%">
<tr class=myinnertable>
<td width="1%">编号</td>
<td width="5%" ><mycim2:contentDisplay id="" default="所在批次"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="晶圆片号"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="reason Category"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="responsibility"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="原因代码"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="原因"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="备注"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="工艺流程"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="工序"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="工步"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="操作人"/></td>
<td width="5%" ><mycim2:contentDisplay id="" default="操作时间"/></td>
</tr>
<logic:iterate id="item" name="page" property="results" indexId="i" >
<tr class=myinnertable2>
<td nowrap >${page.startRow+i}</td>
<td nowrap ><bean:write name="item" property="lotId"/></td>
<td nowrap ><bean:write name="item" property="unitId"/></td>
<td nowrap ><bean:write name="item" property="reasonCategory"/></td>
<td nowrap ><bean:write name="item" property="responsibility"/></td>
<td nowrap ><bean:write name="item" property="reasonCode"/></td>
<td nowrap ><bean:write name="item" property="reason"/></td>
<td nowrap ><bean:write name="item" property="transComments"/></td>
<td nowrap ><bean:write name="item" property="processId"/></td>
<td nowrap ><bean:write name="item" property="routeId"/></td>
<td nowrap ><bean:write name="item" property="operationId"/></td>
<td nowrap ><bean:write name="item" property="transUser"/></td>
<td nowrap ><bean:write name="item" property="transTime"/></td>
</tr>
</logic:iterate>
</table>
</fieldset>
HK移载,翻页
<input type="hidden" name="view" value="" />
<input type="hidden" name="curPage" value="${page.pageNo }" />
<script type="text/javascript">
function page(val) {
$('input[name="curPage"]').val(val);
$('input[name="view"]').val("1");
}
</script>
<!-- 翻页工具 -->
<table width="100%" border="0">
<tr>
<div align="right">
<!-- 首页 -->
<logic:equal value="true" name="page" property="firstPage">
<input type="button" value=" << " disabled="disabled" />
</logic:equal>
<logic:notEqual value="true" name="page" property="firstPage">
<input type="submit" value=" << " name="search" onClick="javascript:page(1);OpenLoadingDiv();"/">
</logic:notEqual>
<!-- 上一页 -->
<logic:equal value="true" name="page" property="hasPrePage">
<input type="submit" value=" < " name="search" onClick="page(${page.prePage});OpenLoadingDiv();"/">
</logic:equal>
<logic:notEqual value="true" name="page" property="hasPrePage">
<input type="button" value=" < " disabled="disabled" />
</logic:notEqual>
<!-- 下一页 -->
<logic:equal value="true" name="page" property="hasNextPage">
<logic:notEqual value="${page.lastPage}" name="page" property="pageNo">
<input type="submit" value=" > " name="search" onClick="page(${page.nextPage});OpenLoadingDiv();"/">
</logic:notEqual>
</logic:equal>
<logic:notEqual value="true" name="page" property="hasNextPage">
<logic:notEqual value="${page.lastPage}" name="page" property="pageNo">
<input type="button" value=" > " disabled="disabled" />
</logic:notEqual>
</logic:notEqual>
<!-- 尾页 -->
<logic:greaterThan value="0" name="page" property="totalPages">
<logic:equal value="false" name="page" property="lastPage">
<input type="submit" value=" >> " name="search" onClick="page(${page.totalPages});OpenLoadingDiv();"/">
</logic:equal>
</logic:greaterThan>
<logic:equal value="0" name="page" property="totalPages">
<input type="button" value=" >> " disabled="disabled" />
</logic:equal>
<logic:equal value="true" name="page" property="lastPage">
<input type="button" value=" >> " disabled="disabled" />
</logic:equal>
</div>
</tr>
</table>
导出excel
Object[][] datas = { { "区域", "总销售额(万元)", "总利润(万元)简单的表格" }, { "江苏省", 9045, 2256 } };
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("table"); // 创建table工作薄
HSSFRow row;
HSSFCell cell;
for (int i = 0; i < datas.length; i++) {
row = sheet.createRow(i);// 创建表格行
for (int j = 0; j < datas[i].length; j++) {
cell = row.createCell(j);// 根据表格行创建单元格
cell.setCellValue(String.valueOf(datas[i][j]));
}
}
wb.write(new FileOutputStream(System.getProperty("user.dir")+"/exportExcel/HSSFWorkbook导出的xls.xls"));