public void setAttachmentpath(String attachmentPath) throws PageException {
//try {
Resource attachmentDir=pageContext.getConfig().getResource(attachmentPath);
if(!attachmentDir.exists() && !attachmentDir.mkdir()) {
attachmentDir=pageContext.getConfig().getTempDirectory().getRealResource(attachmentPath);
if(!attachmentDir.exists() && !attachmentDir.mkdir())
throw new ApplicationException("directory ["+attachmentPath+"] doesent exist and can't created");
}
if(!attachmentDir.isDirectory())throw new ApplicationException("file ["+attachmentPath+"] is not a directory");
pageContext.getConfig().getSecurityManager().checkFileLocation(attachmentDir);
this.attachmentPath = attachmentDir;