麻烦高人能说详细点用什么组件,怎么配置,具体代码,谢谢了我用的服务器是ORACLE+APACHE
解决方案 »
- 急!!!!求高手指点,springMVC+mybatis配置的问题
- struts2标签 遍历map集合 第二集合显示不出来
- 想在网页中显示一张长宽为几米的大图片,像GOOGLE地图
- 有谁知道通过HTTP协议传过来的中文数据采用什么编码格式进行转码
- 7/7:用代码段变量的错误?(好了,终于问完了今天的问题,是不是可以当选单日问题最多奖^_^)
- ??怎么让数据库中的一个包运行??
- 求教,在JSP里能调用其它的应用程序吗,比如说C写的程序,如果能,被调用的程序怎么返回结果给JSP,在线急,,,谢谢。
- 在apache2+tomcat4環境下,設計好的jsp程序,怎麼發布,使在客戶ie上可以瀏覽
- 请教jsp高手
- tomcat部署不了,Server Tomcat v6.0 Server at localhost was unable to start within 45
- 字符串处理问题
- Tomcat后台总是间断性出错而挂掉,急切寻求解答
List upList = new ArrayList();
try {
DiskFileUpload fu = new DiskFileUpload();
//设置最大上传尺寸
fu.setSizeThreshold(1048576); //10M List fileItems = fu.parseRequest(request);
Iterator it = fileItems.iterator();
String fileName = null;
boolean flag = false; while (it.hasNext()) {
FileItem fi = (FileItem) it.next();
long size = fi.getSize();
if(size > 10 * 1024 * 1024){
Map model = new HashMap();
model.put("error", "egis.support.taskprocess.error.A7005");
return new ModelAndView(ViewNames.UPLOAD_ATTACHMENTS_VIEW, model);
}
//获取文件名和内容
fileName = fi.getName();
if(fileName == null || fileName.equals("")){
continue;
} else {
flag = true;
} DevLog.debug("------->original file name is: " + fileName);
int sindex = fileName.lastIndexOf('\\');
if (sindex < 0) {
sindex = fileName.lastIndexOf('/');
}
fileName = sindex < 0 ? fileName : fileName.substring(sindex + 1); UploadAttachmentDTO dto = new UploadAttachmentDTO();
dto.setBusinessActivityId(businessActivityId); int dindex = fileName.lastIndexOf(".");
dto.setAttachmentTypeCode(fileName.substring(dindex + 1).substring(0, 2));
dto.setAttachmentVersionNo("1");
dto.setBusinessActivityTypeCode(businessActivityTypeCode);
dto.setAttachmentHeadline(fileName);
dto.setAttachmentDescription(fileName);
dto.setCreatedUser(userId); String savePath = fileManager.uploadFile(fi.getInputStream(),
DirNameUtil.generateFilePath("", fileName, userId));
dto.setAttachmentPath(savePath); upList.add(dto);
} if(!flag){
throw new Exception("没有选择文件!");
}
它的网站已经不支持下载了。
也不知道如何在APACHE中配置,网上多数说在TOMCAT的配置
晕啊
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws Exception {
try
{
KH010Form thisForm = (KH010Form) form;
KH010Logic KH010Logic = new KH010Logic();
FormFile file=thisForm.getWorkhistory();
FormFile file2 = thisForm.getProjecthistory();
String workfile = file.getFileName();
String projectfile = file2.getFileName(); String uploadPath = BseSystemPropertyCopy.getInstance().getProperty("updown_path")+"\\";
if(!(new File(uploadPath).isDirectory()))
{
new File(uploadPath).mkdir();
} if (!workfile.equals(""))
{
copy2(file,uploadPath);
}
if (!projectfile.equals(""))
{
copy2(file2,uploadPath);
}
KH010Logic.updateFile(thisForm, request,workfile,projectfile);
thisForm.setCloseflg("1");
}
catch (Exception exp)
{
logger.error(exp);
return (mapping.findForward("ERROR"));
}
return (mapping.findForward(KH010Constants.PAGE_KH016));
}
private boolean copy2 (FormFile ff,String fullPath)throws Exception
{
String fname=ff.getFileName();
InputStream in=ff.getInputStream();
OutputStream out=new FileOutputStream(fullPath+fname);//"/"表示保存的路径可以修改为"load/"
int bytesRead=0;
byte[] buffer=new byte[8192];
while((bytesRead=in.read(buffer,0,8192))!=-1)
{
out.write(buffer,0,bytesRead);
}
out.close();
in.close();
ff.destroy();
return true;
}