public class GlueFileDown extends GlueActivity<GlueContext>
Activity Property - file-upload-path : (필수) File이 저장된 Directory Path. - file-name-key : (필수) 화면으로부터 입력된 Download할 Input ID(Key). (File Name이 아니라 Input ID임) - is-real-path : (필수) true/false. 절대경로인지 - result-key : (필수) File을 저장할 Key값 default는 fileNameKey + "_result" 임. 예제사용 예# 1 참고 : HTML Code aaa.txt bbb.txt 참고 : JSP Code <% GlueContext ctx = (GlueContext)request.getAttribute(GlueWebConstants.CONTEXT); if ( ctx != null ) { File file = (File)ctx.get("downfile"); if (file != null && file.exists() ) { //String encodeFileName = java.net.URLEncoder.encode(file.getName(),"UTF-8"); //공백이 "+"로 표시됨. String encodeFileName = new String(file.getName().getBytes("euc-kr"),"8859_1"); response.setContentType("application/octet-stream"); response.setHeader("Content-Disposition","attachment; filename=\""+encodeFileName + "\";"); byte[] temp = new byte[1024]; FileInputStream filestream = new FileInputStream(file); OutputStream outStream = response.getOutputStream(); while( filestream.read(temp) != -1 ) { outStream.write(temp); outStream.flush(); } outStream.close(); } else { %>
dynamicProperties, logger
Constructor and Description |
---|
GlueFileDown() |
Modifier and Type | Method and Description |
---|---|
String |
runActivity(GlueContext ctx)
Sub Class에서 반드시 구현하여야 하는 Abstract Method 이며 이 Method는 F/W에서 호출한다.
|
commitTransaction, commitTransaction, getDao, getEventList, getName, getProperty, getPropertyNames, getTransition, rollbackTransaction, rollbackTransaction, setEventList, setName, setProperty, setTransition
public String runActivity(GlueContext ctx)
GlueActivity
runActivity
in class GlueActivity<GlueContext>
ctx
- GlueContext예)==> return "success"이면 BizLogic Activity 를 실행함.
Copyright © 2023–2024 POSCO DX. All rights reserved.