📄 gbs_serviceinfoaction.java
字号:
package ACTION;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import COMMON.BaseDispatchAction;
import COMMON.MessageList;
import COMMON.ReturnValue;
import COMMON.SystemConstants;
import LOGIC.GBS_ServiceInfoActionLogic;
/**
* GBS_ServiceInfoAction extends BaseDispatchAction implements SystemConstants
* created on 29-07-2004
* @author mxx
* @version 1.0
*/
public class GBS_ServiceInfoAction extends BaseDispatchAction implements SystemConstants {
/**
* method init
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward init(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
log.info("[location info]GBS_ServiceinfoAction.init method!");
GBS_ServiceInfoForm thisForm = (GBS_ServiceInfoForm) form;
//get login user info from session
this.setUserInfoFromSession( request, thisForm);
GBS_ServiceInfoActionLogic logic =
new GBS_ServiceInfoActionLogic( this.getDataSource(request) );
List searchList = new ArrayList();
//GET THE SERVICE INFOMATION LIST
ReturnValue returnValue = logic.getServiceInfoList(thisForm.getLoginPlusHour());
if ( returnValue.isError() && returnValue.isBussinessError() ){
//僄儔乕偑敪惗
MessageList errorMsg = returnValue.getMessageList();
this.setMessage( errorMsg );
}
//else{
//専嶕寢壥傪FormAction偵曐懚偡傞
searchList =(List) returnValue.getDataValue();
thisForm.setLstGBSServiceInfoList( searchList );
//}
return (mapping.findForward(nextview));
}
/**
* method donload
* @param mapping
* @param form
* @param request
* @param response
* @return
* @throws Exception
*/
public ActionForward download(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
log.info("[location info]GBS_ServiceinfoAction.download method!");
GBS_ServiceInfoForm thisForm = (GBS_ServiceInfoForm) form;
this.setUserInfoFromSession( request, thisForm);
// READ DATA
GBS_ServiceInfoActionLogic logic = new GBS_ServiceInfoActionLogic(this.getDataSource(request));
ReturnValue returnValue = logic.getAttachmentFile( thisForm.getSeqno(), response);
//************************
if ( returnValue.isError() ){
if ( returnValue.isBussinessError() ){
this.setMessage( returnValue.getMessageList() );
}
//getErrorCode;getErrorMessage proc
}else{
/*
GBS_File_stBean st =
( GBS_File_stBean ) returnValue.getDataValue();
response.setContentType("APPLICATION/OCTET-STREAM");
String disHeader = "Attachment;Filename=" + st.getFileName() ;
response.setHeader("Content-Disposition", disHeader);
ServletOutputStream os=response.getOutputStream();
os.write( st.getFileData() );
response.setContentLength( (int)st.getFileSize() );
os.flush();
response.flushBuffer();
os.close();
*/
//this.saveToSession( request, "DOWNLOAD_FILE", st);
}
//****************************
return (null);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -