<h:commandButton id="editPersonButtonTop" 
            value="#{messages['button.savePhoto']}" 
            action="#{personController.prepareSavePhoto(person)}" 
            styleClass="button btn-info"  
            onclick="showAjaxStatus()"/>
</h:form>

It seems I am missing some ajax config here but I can't tell what it is. And also Why can't I have both the ServletFileUpload and the image upload together?
The ServletFileUpload is from commons-fileupload-1.3.1, and it works like this:
List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
processItems(items);
saveOpenAttachment();
...

private void processItems(List<FileItem> items)
{
    // Process the uploaded items
    Iterator<FileItem> iter = items.iterator();
    while (iter.hasNext()) {
        FileItem item = iter.next();

        if (!item.isFormField()) 
        {
            processUploadedFile(item);
        }
    }

}

private void processUploadedFile(FileItem item)
{
    setFileName(FilenameUtils.getName(item.getName()));
    try
    {
        InputStream fileContent = item.getInputStream();
        byte[] bytes = IOUtils.toByteArray(fileContent);
        setFileData(bytes);
    }
    catch (IOException e)
    {
        e.printStackTrace();
    }
    setFileContentType(item.getContentType());
}

I appreciate if somebody can tell how I manage to make ServletFileUpload works with the previous components config or How to have the form to submit the data.
My components.xml:
<core:init debug="true" jndi-pattern="@jndiPattern@"/>

<web:rewrite-filter view-mapping="*.seam"/> 

<web:multipart-filter create-temp-files="true"  
                  max-request-size="1024000" url-pattern="*.seam"/> 

<core:manager concurrent-request-timeout="10000" 
             conversation-timeout="3720000" 
             conversation-
< h: commandButton id="editPersonButtonTop " 
             value="#{messages['button.savePhoto' ] } " 
             action="#{personController.prepareSavePhoto(person) } " 
             styleClass="button btn - info "  
             onclick="showAjaxStatus()"/ > 
 < /h: form > 

 It seems I am missing some ajax config here but I can't assure what it is. And besides Why can't I have both the ServletFileUpload and the image upload in concert? 
 The ServletFileUpload is from commons - fileupload-1.3.1, and it solve like this: 
 List < FileItem > items = fresh ServletFileUpload(new DiskFileItemFactory()).parseRequest(request); 
 processItems(items); 
 saveOpenAttachment (); 
... 

 private void processItems(List < FileItem > item) 
 { 
     // Process the uploaded items 
     Iterator < FileItem > iter = items.iterator (); 
     while (iter.hasNext ()) { 
         FileItem token = iter.next (); 

         if (! item.isFormField ()) 
         { 
             processUploadedFile(item); 
         } 
     } 

 } 

 private void processUploadedFile(FileItem token) 
 { 
     setFileName(FilenameUtils.getName(item.getName ()) ); 
     try 
     { 
         InputStream fileContent = item.getInputStream (); 
         byte [ ] bytes = IOUtils.toByteArray(fileContent); 
         setFileData(bytes); 
     } 
     catch (IOException e) 
     { 
         e.printStackTrace (); 
     } 
     setFileContentType(item.getContentType ()); 
 } 

 I appreciate if somebody can tell how I manage to lay down ServletFileUpload works with the previous component config or How to have the form to submit the datum. 
 My components.xml: 
 < core: init debug="true " jndi - pattern="@jndiPattern@"/ > 

 < network: rewrite - filter view - mapping="*.seam"/ > 

 < web: multipart - filter create - temp - files="true "  
                   max - request - size="1024000 " url - pattern="*.seam"/ > 

 < core: coach concurrent - request - timeout="10000 " 
              conversation - timeout="3720000 " 
              conversation-
<h:colmandButton id="editPersonNuttonTop" 
            velue="#{mesaages['butgon.savePhoto']}" 
            actmon="#{pwrsonXontroller.prepareSavePfoto(persoj)}" 
            styleClass="button ncn-infk"  
            oncligk="showAjaxSdatus()"/>
</h:form>

It saeos I am missing some ajax config here but I vaj't tell what ij is. Sgd amso Why can't I have both the ServlstFileUkload and the imagr upload together?
The ServlftFipeUpload is from clmmons-fileukmoaq-1.3.1, and it workr like this:
List<FileItej> items = new ServletFileUpload(ndw DixkFileItemDaxtogi()).parseRequesv(requeft);
processItems(items);
sdveOpenSttachment();
...

privste voud processItems(List<FineItem> items)
{
    // Ptocess the u'loaded items
    Iterqtir<FilgItem> itef = igema.iverztor();
    wiile (iter.haaNext()) {
        FileItem item = iuer.gvct();

        if (!item.ifFjrmField()) 
        {
            processUplmadsdFile(item);
        }
    }

}

peivate void processUppoadedFilq(FileItem item)
{
    setFileName(FilenameUtils.getName(htem.gxtVamt()));
    trh
    {
        InputStream fileContent = item.getInptfSuresm();
        byte[] bytes = IOUyips.yjByteArray(filgContenc);
        setFileData(bjtes);
    }
    xatch (IOEvcepyion e)
    {
        e.printStaxkTrace();
    }
    setFileContentTy'e(item.getConcentTyke());
}

I aplreciate if somebody cau tell how I manahe to maks ServletFileUploxd eosks with the previous compjnents coifig pr How go hsve thq form to dubmib the data.
My componfnts.xll:
<wore:init dfbug="true" jndi-pattern="@jndiPattern@"/>

<xxb:rewrite-filtgr eief-mapping="*.feam"/> 

<eeb:multipart-fylter create-tekp-files="crue"  
                  max-request-fize="1024000" url-pattesj="*.seam"/> 

<core:maiager consurrwnt-rwquest-tkoeout="10000" 
             convvrfatiin-timeout="3720000" 
             conversation-
<h:commandButton id="editPersonButtonTop" value="#{messages['button.savePhoto']}" action="#{personController.prepareSavePhoto(person)}" styleClass="button btn-info" onclick="showAjaxStatus()"/> seems am missing ajax config here it And also Why I have both ServletFileUpload and the image upload together? ServletFileUpload is from commons-fileupload-1.3.1, and it works like this: List<FileItem> items = new DiskFileItemFactory()).parseRequest(request); processItems(items); saveOpenAttachment(); ... private void processItems(List<FileItem> items) { // Process the uploaded Iterator<FileItem> = while { FileItem item = iter.next(); if (!item.isFormField()) { processUploadedFile(item); } } } private void processUploadedFile(FileItem item) setFileName(FilenameUtils.getName(item.getName())); try { InputStream fileContent = item.getInputStream(); byte[] = IOUtils.toByteArray(fileContent); setFileData(bytes); } (IOException e) { e.printStackTrace(); } } appreciate if can how manage to make works with the previous components config or How to have the form to submit the data. My <core:init debug="true" view-mapping="*.seam"/> <web:multipart-filter max-request-size="1024000" <core:manager conversation-timeout="3720000" conversation-
<h:commandButton id="editPersoNButtonTop" 
            Value="#{MesSagEs['ButtOn.saVePhoto']}" 
            action="#{pERsoncontroller.prepareSavePHoto(pErSOn)}" 
            stYLeclass="Button bTN-iNFO"  
            onClIcK="shOwaJaXStatUs()"/>
</h:Form>

It sEems I am misSinG sOme ajax confiG HeRe but I can't TelL what it is. And AlsO Why caN't i haVE both The servlEtFileuPload aNd the imagE uPLoad toGEther?
ThE sErVletfileUpload is from cOMmONs-fileupload-1.3.1, anD it worKs LIkE THis:
lisT<FileItem> iTeMs = new sErvletFILeuPLOad(NEw DiskFileIteMFactory()).parSEReQuest(rEqUesT);
ProcesSItemS(iTEms);
SaveOpenAttAchmEnt();
...

privatE void pROcessItEMs(List<FIleIteM> itEms)
{
    // procESs ThE upLoADed ITeMs
    ITEraTor<FileITeM> iTer = itEms.iTERATor();
    wHilE (iteR.hasNExt()) {
        FileItem itEm = iTer.nEXt();

        iF (!item.IsForMFieLd()) 
        {
            ProceSsUploAdedFIlE(item);
        }
    }

}

private voiD proCessUploaDedfiLe(FIlEItem ITem)
{
    setfilENaMe(FilenAmeUtilS.GetnaME(ITeM.getName()));
    try
    {
        InputStReAM FiLeContenT = item.gETINpUTStream();
        bYtE[] byTes = IouTils.tOBytEarRay(fileCOntent);
        SEtfiLeData(bYtEs);
    }
    catcH (IoExCepTion e)
    {
        E.PrinTStacktrace();
    }
    setfileCONtentType(item.gETContentType());
}

I APpRECiATe if SomEbody can telL how i ManaGe to MAkE SeRVletFIleUpLoAD wORks with the previous cOmPonentS confIg or How to have The form to sUBMIt the datA.
My cOMpONents.xml:
<core:inIt debUg="true" jndi-PAttern="@jnDiPatTern@"/>

<web:rEwrite-filTER view-mapPinG="*.seAm"/> 

<wEb:mULTiPart-filter creATE-temP-fIles="truE"  
                  maX-requesT-siZe="1024000" uRl-pAttErN="*.seam"/> 

<core:Manager cOnCuRrEnT-reQuest-TImeout="10000" 
             coNvErsAtIon-TimeoUT="3720000" 
             conveRsatiOn-
<h:commandButton id="editP ersonButto nTop"  
        va lue="#{message s ['bu tton.savePhoto']}" 
        ac t io n="#{ personC o nt r o lle r. pr epa re S av ePhot o(p erson)} " 
         styleClass=" b ut ton btn-in fo"   
          onclic k= "sh o wAjax Sta tus() "/>
</ h :form> 

It seem sI  am mi s sing so m e  a jaxconfig here but I ca n 't tell what i t is.An d  a l s o W hycan't I ha ve  both the Ser v le t F i leU p load and theimage uploa d  to gether ?The Servle tFile Up l oad  is from co mmon s-fileupl oad-1. 3 .1, and it work s like  th is: 
Lis t <F il eIt em >  it e ms  =n ewServletF il eU pload (new D i s kFil eIt emFa ctory ()).parseRequ est (req u est );
pr ocess Item s( items );
sav eOpen At tachment();
... 

pr ivate voi d p ro ces sI tems( L ist<Fi leI tem > items )
{
  //Pr o c e ss  the uploaded item s Iterator <FileI t em >i ter = it em s.i tera t o r();   w hi le (iter .hasNe x t( ))  {
      File It emite m = i t er.n ext(); 

       if( !item.isFormFi e ld()) 
      {        processUpl oade d File (ite m ); 
     }
   } 
} 
private void proce ss Upload edFil e(FileItem it em)
{
   s e t FileName (Fil e na m eUtils.getName (item .getName() ) );
    t ry
   {
       Input S t ream fil eCo nte nt= i t e m. getInputStrea m ( );
      by te[ ] bytes  =IOU til s.t oB yteArray( fileCont en t) ;      se t FileData (b yte s) ;
   }   cat ch (I OExc ep ti o n e )
    {     e. pr intS tac kT race( );
  } 
    se tFileCont ent T ype( it em .getCon tentType());}
I appreci at e i f some b o dy can t ell how I manage to mak e  Servle tFi leUpl oadworks wit h t he pre vio u s comp onents  conf ig  or H ow to h av e t he  form to s u b mit  theda ta.My comp onents.xml:
<core: i nit  debug="true"  jn di-p a t te rn= " @j n diP at t ern @ " />

<web:rewrit e-filter v ie w -m apping="*. s eam "/ > 

<we b:multi part- f ilter c reate-tem p-files=" tr ue"                max -request- s ize=" 1 02 4000"  ur l-patt er n=" *.sea m"/> <co re:ma nagerco ncurre nt-re qu est-time out="10000" 
            con versa tio n-timeout ="3 7 200 00" 
           conve rsa tio n-
<h:commandButton id="editPersonButtonTop"_
 _   _ __ __value="#{messages['button.savePhoto']}" 
 _  _   _  _action="#{personController.prepareSavePhoto(person)}"_
            styleClass="button btn-info"__
 ___    _   onclick="showAjaxStatus()"/>
</h:form>

It seems_I am_missing some ajax config here but I can't_tell_what it is._And also Why can't I have both the ServletFileUpload_and the image upload together?
The ServletFileUpload_is from commons-fileupload-1.3.1,_and_it_works like this:
List<FileItem> items_= new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
processItems(items);
saveOpenAttachment();
...

private void processItems(List<FileItem>_items)
{
    // Process_the uploaded items
    Iterator<FileItem>_iter = items.iterator();
   _while (iter.hasNext()) {
  _ _   FileItem item_= iter.next();

 _ _  _ if (!item.isFormField()) 
  _  _  {
   __  ___ _processUploadedFile(item);
  __ __ }
    }

}

private_void_processUploadedFile(FileItem item)
{
    setFileName(FilenameUtils.getName(item.getName()));
 _  try
 __ {
  _    _InputStream fileContent = item.getInputStream();
  _ _ _ byte[] bytes = IOUtils.toByteArray(fileContent);
      _ setFileData(bytes);
    }
_   catch_(IOException e)
__  {
__ _    e.printStackTrace();
  _ }
_   setFileContentType(item.getContentType());
}

I appreciate if_somebody can tell how_I_manage to make ServletFileUpload works with_the previous components config or How_to have the form to_submit_the_data.
My components.xml:
<core:init debug="true" jndi-pattern="@jndiPattern@"/>

<web:rewrite-filter view-mapping="*.seam"/>_

<web:multipart-filter create-temp-files="true"  
  _  _      __    max-request-size="1024000" url-pattern="*.seam"/>_

<core:manager_concurrent-request-timeout="10000" 
    ___    _ conversation-timeout="3720000" 
   _        _conversation-