본문 바로가기

프로그래밍/java11

jsp 파일 다운로드 jsp자체 객체 out=pageContext.pushBody(); //out--> jsp자체 객체 outStream = response.getOutputStream(); outStream.write(byteStream); }catch(Exception e) { System.out.println(e); }finally { if(fileStream != null) fileStream.close(); if(outStream != null) outStream.close(); } %> 2012. 9. 18.
jsp 페이지에서 보안서버 http 로 접근시 --> https 로 이동 jsp 페이지에서 보안서버 http 로 접근시 --> https 로 이동 String url = javax.servlet.http.HttpUtils.getRequestURL(request).toString(); if(url.indexOf("http://") > -1 ) { response.sendRedirect(url.replaceAll("http://","https://") +"?"+ request.getQueryString()); return; } 2012. 9. 12.
org.apache.commons.fileupload 파일 업로드 eontConfig tc = new eontConfig(); String path = tc.getConfigValue("AttachPathOutBound");  String yyyy = new java.text.SimpleDateFormat ("yyyy").format(new java.util.Date());  String MM = new java.text.SimpleDateFormat ("MM").format(new java.util.Date());  String dd = new java.text.SimpleDateFormat ("dd").format(new java.util.Date());      path = path + "/" + yyyy; File f = new File(path); if(!f... 2012. 8. 16.
org.apache.commons.mail 메일 보내기 package eont.mail; import org.apache.commons.mail.*; import org.apache.log4j.Logger; import org.springframework.stereotype.Service; import java.util.*; import javax.mail.*; import java.io.*; import java.awt.image.*; import javax.imageio.*; import javax.imageio.ImageIO.*; import eont.mail.WebImage; import eont.xml.eontConfig; public class SendHtmlEmail { static final Logger logger = Logger.getLog.. 2012. 8. 16.