Anônimo | Bom dia Carlos,
Atualizei a aplicação de exemplo, para versão 2.4.0 do Demoiselle:
https://github.com/demoiselle/laboratory/tree/master/estacionamento/v240
Incluí um exemplo com fileUpload, e as alterações foram basicamente as que o pessoal comentou. Só tive um pouco mais de trabalho pois quis gravar imagens no banco e depois exibi-las com o componente p:graphicImage Fiz o exemplo para a classe Cliente (Cliente.java, ClienteEditMB, cliente_edit.xhtml)
T+. -- Emerson Sachio Saito DS/CETEC/CTCTA http://www.serpro.gov.br http://www.frameworkdemoiselle.gov.br
Em 27/04/2014 09:43:39, Carlos escreveu: > Olá Ale. Implementei o método de upload, alterei o xhtml, configurei o pom e o web.xml, mas ao acionar o upload o método não é executado. O post acontece mas não passa pelo método definido no "fileUploadListener". Será que pode estar faltando mais alguma configuração?
at+
Em 23 de abril de 2014 16:47, Ale W. Feltes Quenhan > escreveu:
> Hola Carlos, aquí tienes un proyecto que usa un fork del demoiselle-2.2.2, > que podrías tomar de ejemplo: > Utilizamos para este proyecto el Primefaces 3.5. > Aquí las dependencias para el pom: > > > https://github.com/alefq/asistente-eventos/blob/master/pom.xml#L81> > > Aquí la línea en el xhtml: > > > > https://github.com/alefq/asistente-eventos/blob/master/src/main/webapp/evento_edit.xhtml#L100> > > y aquí el código en el ViewController que recibe el archivo: > > > > https://github.com/alefq/asistente-eventos/blob/master/src/main/java/py/gov/senatics/asistente/view/EventoEditMB.java#L220> > > > > > 2014-04-23 10:57 GMT-04:00 Carlos > : > > > Olá Rafael e Jefferson, sim eu esqueci de comentar mas tbm coloquei as > > dependencias citadas no pom.xml. > > O form esta como multpart e só vou verificar referente a configuração > > adicional do web.xml que o Jefferson comentou. > > Quero tbm fazer um teste com este TIKA que o Rodolfo falou. > > > > > > pom.xml: > > ..... > > > > > > commons-fileupload> > > > commons-fileupload> > > > 1.2.1> > > > > > > > > > > > commons-io> > > > commons-io> > > > 1.4> > > > > > ..... > > > > > > at+ > > > > > > > > Em 23 de abril de 2014 11:50, Rafael Odon > > > escreveu: > > > > > Precisei usar isso ante-ontem, e sim, precisa mesmo do apache > > > commons-file-upload no pom.xml. > > > > > > Também tem que declarar no no web.xml o > > > filtro org.primefaces.webapp.filter.FileUploadFilter > > > > > > E não se esqueça que o form ao redor do campo de upload tem que ter o > > > enctype declarado: > > > > > > > > > > ... > > > > > > > > > > > > > 2014-04-23 11:47 GMT-03:00 Jefferson Bicca Charczuk < > > > jefferson.rs@gmail.com> > > > : > > > > > > > Opa, Carlos. > > > > > > > > Já utilizei este componente do Primefaces uma vez e, se não me > engano, > > > tive > > > > de incluir a dependência ao commons-fileupload no pom: > > > > > > > > > > commons-fileupload> > > > > > commons-fileupload> > > > > > 1.3> > > > > > > > > > > > > > Tenta colocar essa dependência aí, faz um novo teste e nos diga se > > > > conseguiu fazer funcionar certinho. > > > > > > > > Outra configuração que cheguei a fazer também, mas acho que é > opcional, > > > foi > > > > definir lá no web.xml um uploadDirectory. Vou te colar aqui a > > > configuração > > > > que fiz: > > > > > > > > > PrimeFaces FileUpload Filter> > > > > > > > > > > > org.primefaces.webapp.filter.FileUploadFilter> > > > > > thresholdSize> > > > > > 51200> > > > > > uploadDirectory> > > > /tmp> > > > > > PrimeFaces > > > FileUpload > > > > Filter> Faces Servlet> > > > > > > > > > > > > > At. > > > > > > > > > > > > 2014-04-23 11:34 GMT-03:00 Rodolfo > : > > > > > > > > > Procure sobre o apache tika. > > > > > > > > > > > > > > > Em 23 de abril de 2014 10:26, Carlos > > > > escreveu: > > > > > > > > > > > Olá, > > > > > > a princípio eu configurei os filters e o MenageBean de acordo > > com o > > > > > > exemplo do site do primefaces, mas ao executar a ação o upload > não > > > > > ocorre. > > > > > > A necessidade é de efetuar upload de um arquivo e depois > > persistir > > > > este > > > > > > arquivo no banco de dados, em uma coluna específica de uma > tabela. > > > > > > Minha implementação possui as seguintes caracteristicas: > > > > > > public class UploadFileMB extends AbstractPageBean > > > > > > .... > > > > > > public void doUpload(FileUploadEvent fileUploadEvent) { > > > > > > System.out.println("TESTEEE"); > > > > > > UploadedFile uploadedFile = > > > fileUploadEvent.getFile(); > > > > > > String fileNameUploaded = > > uploadedFile.getFileName(); > > > > > > long fileSizeUploaded = uploadedFile.getSize(); > // > > 3 > > > > > > String infoAboutFile = " > Arquivo recebido: > > > " > > > > > > +fileNameUploaded > > > > > > + " > " + "Tamanho do > > Arquivo: > > > > > > > " +fileSizeUploaded > > > > > > + "> "; > > > > > > FacesContext facesContext = > > > > > FacesContext.getCurrentInstance > > > > > > (); > > > > > > facesContext.addMessage(null , new > > > > > > FacesMessage("Sucesso",infoAboutFile > > > > > > )); > > > > > > } .... } xhtml: > http://www.w3.org/1999/xhtml" > > > > > > xmlns:f="> http://java.sun.com/jsf/core"> > > > > > > xmlns:p="> http://primefaces.org/ui"> > > > > > > xmlns:h="> http://java.sun.com/jsf/html"> > > > > > > xmlns:ui="> http://java.sun.com/jsf/facelets"> > > > > > > template="/template/main.xhtml"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > fileUploadListener= > > > > > > "#{uploadFileMB.doUpload}" > > > > > > mode="advanced" > > > dragDropSupport="true" > > > > > > validatorMessage="Erro no Upload" > > > > > > sizeLimit="100000" allowTypes= > > > > > > "/(\.|\/)(xml|zip|7zip|rar|7z)$/" > > > > > > label="Procurar..." /> > > > > > > > ..... > > > > > > > > > > > > > > > web.xml: > > > > > > > > > > > > > > > PrimeFaces FileUpload > > > Filter> > > > > > > > > > > > > org.primefaces.webapp.filter.FileUploadFilter > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > PrimeFaces FileUpload > > > Filter> > > > > > > > Faces Servlet> > > > > > > > FORWARD> > > > > > > > At+ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Em 23 de abril de 2014 11:11, Emerson Sachio Saito < > > > > > > emerson.saito@serpro.gov.br> escreveu: > > > > > > > > > > > > > Olá Carlos, > > > > > > > > > > > > > > Nos exemplos com o Demoiselle 2, ainda não usamos este > > componente. > > > > > > > Acho que já deve ter visto os exemplos do Primefaces: > > > > > > > - > http://www.primefaces.org/showcase/ui/fileUploadSingle.jsf> > > > > > > > - > http://www.primefaces.org/showcase/ui/fileUploadMultiple.jsf> > > > > > > > > > > > > > > Qual está sendo sua dificuldade? > > > > > > > Vou ver se faço um teste e vamos trocando idéias. > > > > > > > > > > > > > > T+. > > > > > > > -- > > > > > > > Emerson Sachio Saito > > > > > > > DS/CETEC/CTCTA > > > > > > > > http://www.serpro.gov.br> > > > > > > > > http://www.frameworkdemoiselle.gov.br> > > > > > > > (41) 3593-8791 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Em 22/04/2014 20:39:43, Carlos escreveu: > > > > > > > > Olá. > > > > > > > Alguém tem um exemplo de upload de arquivo, usando > primefaces? > > > > > > > Procurei no github dentro dos exemplos mas não encontrei. > > > > > > > > > > > > > > Valeu. > > > > > > > > > > > > > > -- > > > > > > > ______________ > > > > > > > ->Carlos Henrique Marian > > > > > > > :0) :0\ :0| :0/ :0( > > > > > > > |/--\|/--\|/--\| > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > > > Start Your Social Network Today - Download eXo Platform > > > > > > > Build your Enterprise Intranet with eXo Platform Software > > > > > > > Java Based Open Source Intranet - Social, Extensible, Cloud > Ready > > > > > > > Get Started Now And Turn Your Intranet Into A Collaboration > > > Platform > > > > > > > > > http://p.sf.net/sfu/ExoPlatform> > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > Portal: > > http://www.frameworkdemoiselle.gov.br> > > > > > > > > Foruns: > > http://forum.frameworkdemoiselle.gov.br> > > > > > > > > Tracker: > > http://tracker.frameworkdemoiselle.gov.br> > > > > > > > > _______________________________________________ > > > > > > > > > > > > > > Para editar sua assinatura: > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > - > > > > > > > > > > > > > > > > > > > > > "Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS > > > (SERPRO), > > > > > > > empresa pública federal regida pelo disposto na Lei Federal nº > > > > 5.615, é > > > > > > > enviada exclusivamente a seu destinatário e pode conter > > informações > > > > > > > confidenciais, protegidas por sigilo profissional. Sua > utilização > > > > > > > desautorizada é ilegal e sujeita o infrator às penas da lei. Se > > > você > > > > a > > > > > > > recebeu indevidamente, queira, por gentileza, reenviá-la ao > > > emitente, > > > > > > > esclarecendo o equívoco." > > > > > > > > > > > > > > "This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS > > > (SERPRO) > > > > > -- > > > > > > a > > > > > > > government company established under Brazilian law (5.615/70) > -- > > is > > > > > > > directed exclusively to its addressee and may contain > > confidential > > > > > data, > > > > > > > protected under professional secrecy rules. Its unauthorized > use > > is > > > > > > illegal > > > > > > > and may subject the transgressor to the law's penalties. If > > you're > > > > not > > > > > > the > > > > > > > addressee, please send it back, elucidating the failure." > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > > > Start Your Social Network Today - Download eXo Platform > > > > > > > Build your Enterprise Intranet with eXo Platform Software > > > > > > > Java Based Open Source Intranet - Social, Extensible, Cloud > Ready > > > > > > > Get Started Now And Turn Your Intranet Into A Collaboration > > > Platform > > > > > > > > http://p.sf.net/sfu/ExoPlatform> > > > > > > > _______________________________________________ > > > > > > > > > > > > > > Portal: > http://www.frameworkdemoiselle.gov.br> > > > > > > > Foruns: > http://forum.frameworkdemoiselle.gov.br> > > > > > > > Tracker: > http://tracker.frameworkdemoiselle.gov.br> > > > > > > > _______________________________________________ > > > > > > > > > > > > > > Para editar sua assinatura: > > > > > > > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > ______________ > > > > > > ->Carlos Henrique Marian > > > > > > :0) :0\ :0| :0/ :0( > > > > > > |/--\|/--\|/--\| > > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > > Start Your Social Network Today - Download eXo Platform > > > > > > Build your Enterprise Intranet with eXo Platform Software > > > > > > Java Based Open Source Intranet - Social, Extensible, Cloud Ready > > > > > > Get Started Now And Turn Your Intranet Into A Collaboration > > Platform > > > > > > > http://p.sf.net/sfu/ExoPlatform> > > > > > > _______________________________________________ > > > > > > > > > > > > Portal: > http://www.frameworkdemoiselle.gov.br> > > > > > > Foruns: > http://forum.frameworkdemoiselle.gov.br> > > > > > > Tracker: > http://tracker.frameworkdemoiselle.gov.br> > > > > > > _______________________________________________ > > > > > > > > > > > > Para editar sua assinatura: > > > > > > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users> > > > > > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > Start Your Social Network Today - Download eXo Platform > > > > > Build your Enterprise Intranet with eXo Platform Software > > > > > Java Based Open Source Intranet - Social, Extensible, Cloud Ready > > > > > Get Started Now And Turn Your Intranet Into A Collaboration > Platform > > > > > > http://p.sf.net/sfu/ExoPlatform> > > > > > _______________________________________________ > > > > > > > > > > Portal: > http://www.frameworkdemoiselle.gov.br> > > > > > Foruns: > http://forum.frameworkdemoiselle.gov.br> > > > > > Tracker: > http://tracker.frameworkdemoiselle.gov.br> > > > > > _______________________________________________ > > > > > > > > > > Para editar sua assinatura: > > > > > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users> > > > > > > > > > > > > > > > > > > > > > -- > > > > Jefferson Bicca Charczuk > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > Start Your Social Network Today - Download eXo Platform > > > > Build your Enterprise Intranet with eXo Platform Software > > > > Java Based Open Source Intranet - Social, Extensible, Cloud Ready > > > > Get Started Now And Turn Your Intranet Into A Collaboration Platform > > > > > http://p.sf.net/sfu/ExoPlatform> > > > > _______________________________________________ > > > > > > > > Portal: > http://www.frameworkdemoiselle.gov.br> > > > > Foruns: > http://forum.frameworkdemoiselle.gov.br> > > > > Tracker: > http://tracker.frameworkdemoiselle.gov.br> > > > > _______________________________________________ > > > > > > > > Para editar sua assinatura: > > > > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users> > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > > Start Your Social Network Today - Download eXo Platform > > > Build your Enterprise Intranet with eXo Platform Software > > > Java Based Open Source Intranet - Social, Extensible, Cloud Ready > > > Get Started Now And Turn Your Intranet Into A Collaboration Platform > > > > http://p.sf.net/sfu/ExoPlatform> > > > _______________________________________________ > > > > > > Portal: > http://www.frameworkdemoiselle.gov.br> > > > Foruns: > http://forum.frameworkdemoiselle.gov.br> > > > Tracker: > http://tracker.frameworkdemoiselle.gov.br> > > > _______________________________________________ > > > > > > Para editar sua assinatura: > > > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users> > > > > > > > > > > > -- > > ______________ > > ->Carlos Henrique Marian > > :0) :0\ :0| :0/ :0( > > |/--\|/--\|/--\| > > > > > ------------------------------------------------------------------------------ > > Start Your Social Network Today - Download eXo Platform > > Build your Enterprise Intranet with eXo Platform Software > > Java Based Open Source Intranet - Social, Extensible, Cloud Ready > > Get Started Now And Turn Your Intranet Into A Collaboration Platform > > > http://p.sf.net/sfu/ExoPlatform> > > _______________________________________________ > > > > Portal: > http://www.frameworkdemoiselle.gov.br> > > Foruns: > http://forum.frameworkdemoiselle.gov.br> > > Tracker: > http://tracker.frameworkdemoiselle.gov.br> > > _______________________________________________ > > > > Para editar sua assinatura: > > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users> > > > > > > -- > Ale > > ------------------------------------------------------------------------------ > Start Your Social Network Today - Download eXo Platform > Build your Enterprise Intranet with eXo Platform Software > Java Based Open Source Intranet - Social, Extensible, Cloud Ready > Get Started Now And Turn Your Intranet Into A Collaboration Platform > > http://p.sf.net/sfu/ExoPlatform> > _______________________________________________ > > Portal: > http://www.frameworkdemoiselle.gov.br> > Foruns: > http://forum.frameworkdemoiselle.gov.br> > Tracker: > http://tracker.frameworkdemoiselle.gov.br> > _______________________________________________ > > Para editar sua assinatura: > > https://lists.sourceforge.net/lists/listinfo/demoiselle-users> >
-- ______________ ->Carlos Henrique Marian :0) :0\ :0| :0/ :0( |/--\|/--\|/--\| ------------------------------------------------------------------------------ Start Your Social Network Today - Download eXo Platform Build your Enterprise Intranet with eXo Platform Software Java Based Open Source Intranet - Social, Extensible, Cloud Ready Get Started Now And Turn Your Intranet Into A Collaboration Platform > http://p.sf.net/sfu/ExoPlatform> _______________________________________________
Portal: > http://www.frameworkdemoiselle.gov.br> Foruns: > http://forum.frameworkdemoiselle.gov.br> Tracker: > http://tracker.frameworkdemoiselle.gov.br> _______________________________________________
Para editar sua assinatura: > https://lists.sourceforge.net/lists/listinfo/demoiselle-users> > @gmail.com>> @gmail.com>> @gmail.com>> @gmail.com>> @gmail.com>
-
"Esta mensagem do SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO), empresa pública federal regida pelo disposto na Lei Federal nº 5.615, é enviada exclusivamente a seu destinatário e pode conter informações confidenciais, protegidas por sigilo profissional. Sua utilização desautorizada é ilegal e sujeita o infrator às penas da lei. Se você a recebeu indevidamente, queira, por gentileza, reenviá-la ao emitente, esclarecendo o equívoco."
"This message from SERVIÇO FEDERAL DE PROCESSAMENTO DE DADOS (SERPRO) -- a government company established under Brazilian law (5.615/70) -- is directed exclusively to its addressee and may contain confidential data, protected under professional secrecy rules. Its unauthorized use is illegal and may subject the transgressor to the law's penalties. If you're not the addressee, please send it back, elucidating the failure." ------------------------------------------------------------------------------ "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE Instantly run your Selenium tests across 300+ browser/OS combos. Get unparalleled scalability from the best Selenium testing platform available. Simple to use. Nothing to install. Get started now for free." http://p.sf.net/sfu/SauceLabs _______________________________________________
Portal: http://www.frameworkdemoiselle.gov.br Foruns: http://forum.frameworkdemoiselle.gov.br Tracker: http://tracker.frameworkdemoiselle.gov.br _______________________________________________
Para editar sua assinatura: https://lists.sourceforge.net/lists/listinfo/demoiselle-users |