📄 uploadbean.java
字号:
package com.esri.solutions.jitk.web.tasks.redlining.graphics;
import com.esri.adf.web.data.WebContext;
import com.esri.adf.web.util.WebUtil;
import java.util.Map;
import org.apache.log4j.Logger;
/**
* This bean handles uploading of the graphics file.
*/
public class UploadBean {
private static final Logger _logger = Logger.getLogger(UploadBean.class);
private String id; //upload id
private String filename; //upload filename
private WebContext webContext;
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getFilename() {
return this.filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public WebContext getWebContext() {
return this.webContext;
}
public void setWebContext(WebContext webContext) {
this.webContext = webContext;
}
@SuppressWarnings("unchecked")
public void setGraphics() {
try {
//get data from session map : it won't do anything...
Map sessionMap = WebUtil.getExternalContext().getSessionMap();
byte[] data = (byte[])sessionMap.get(this.id);
WebUtil.getExternalContext().getSessionMap().put(id, data);
}
catch (Exception e) {
_logger.error("Could not set uploaded graphic to session", e);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -