Search Results

Search found 3 results on 1 pages for 'kbrin80'.

Page 1/1 | 1 

  • Setting up new project in eclispe

    - by kbrin80
    So I set up a new project into eclipse and created a build.xml that creates a war file. The problem that I am having is that the only files that are included in the war are whats in the WEB-INF. How do you include my web folder into the war. Project src web WEB-INF

    Read the article

  • Issue with multipart/form-data

    - by kbrin80
    I am not able to get values from both files and text input in a servlet when my form includes multipart/form-data. I am using the apache.commons.fileuploads for help with the uploads. Any suggestions. Also in the code below there are some things that I feel should be more efficient. Is there a better way to store these multiple files in a db. public void performTask(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) { boolean promo = false; Database db = new Database(); Homepage hp = db.getHomePageContents(); String part = ParamUtils.getStringParameter(request, "part", ""); if(part.equals("verbage")) { String txtcontent = (String)request.getParameter("txtcontent"); String promoheader = (String)request.getParameter("promoheader"); String promosubheader = (String)request.getParameter("promosubheader"); hp.setBodyText(txtcontent); hp.setPromoHeader(promoheader); hp.setPromoSubHeader(promosubheader); System.err.println(txtcontent); } else { boolean isMultipart = ServletFileUpload.isMultipartContent(request); if (!isMultipart) { } else { FileItemFactory factory = new DiskFileItemFactory(); ServletFileUpload upload = new ServletFileUpload(factory); List items = null; try { items = upload.parseRequest(request); //System.err.print(items); } catch (FileUploadException e) { e.printStackTrace(); } Iterator itr = items.iterator(); while (itr.hasNext()) { FileItem item = (FileItem) itr.next(); if(item.getFieldName().equals("mainimg1")) { if(item.getName() !="") hp.setMainImg1(item.getName()); } if(item.getFieldName().equals("mainimg2")) { if(item.getName() !="") hp.setMainImg2(item.getName()); } if(item.getFieldName().equals("mainimg3")) { if(item.getName() !="") hp.setMainImg3(item.getName()); } if(item.getFieldName().equals("promoimg1")) { promo = true; if(item.getName() !="") { hp.setPromoImg1(item.getName()); try { File savedFile = new File("/Library/resin-4.0.1/webapps/ROOT/images/promoImg1.jpg"); item.write(savedFile); //System.err.print(items); } catch (Exception e) { System.err.println(e.getMessage()); } } } if(item.getFieldName().equals("promoimg2")) { if(item.getName() !="") { hp.setPromoImg2(item.getName()); try { File savedFile = new File("/Library/resin-4.0.1/webapps/ROOT/images/promoImg2.jpg"); item.write(savedFile); //System.err.print(items); } catch (Exception e) { System.err.println(e.getMessage()); } } } if(item.getFieldName().equals("promoimg3")) { if(item.getName() !="") { hp.setPromoImg3(item.getName()); try { File savedFile = new File("/Library/resin-4.0.1/webapps/ROOT/images/promoImg3.jpg"); item.write(savedFile); //System.err.print(items); } catch (Exception e) { System.err.println(e.getMessage()); } } } System.err.println("FNAME =" + item.getFieldName() + " : " + item.getName()); if (item.isFormField()) { } else { try { if(!promo) { String itemName = item.getName(); File savedFile = new File("/Library/resin-4.0.1/webapps/ROOT/images/"+itemName); item.write(savedFile); } //System.err.print(items); } catch (Exception e) { System.err.println(e.getMessage()); } } } } } db.updateHomePageContent(hp);

    Read the article

  • Setting up new project in Eclipse

    - by kbrin80
    So I set up a new project into Eclipse and created a build.xml that creates a war file. The problem that I am having is that the only files that are included in the war are what's in the WEB-INF. How do you include my web folder into the war? Project src web WEB-INF

    Read the article

1