You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Edson Richter <ed...@hotmail.com> on 2013/06/01 19:07:32 UTC
BeanUtils 1.8.3 not working with Java 7
Dear friends,
I've searched everywhere and could not find the source for this problem.
When running my application with Java 6, it works as expected.
When running with Java 7, I get no content.
Example:
in html, I have:
<form ...>
<input type='text' name='acao' value='avancar'>
<input type='text' name='informacoes.documento' value='12345678'>
</form>
The bean is declared with setter and getters as follows:
public class MyBean implements Serializable {
private String acao;
private Informacoes informacoes = new Informacoes();
public MyBeans() {}
public String getAcao() { return acao; }
public void setAcao(String acao) { this.acao = acao; }
public Informacoes getInformacoes() { return this.informacoes; }
public void setInformacoes(Informacoes info) { this.informacoes =
informacoes; }
}
public class Informacoes implements Serializable {
private String documento;
public Informacoes() {}
public String getDocumento() { return this.documento; }
public void setDocumento(String doc) { this.documento = doc; }
}
My servlet make the following call:
protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
String acao = request.getParameter("acao");
System.out.println("Acao = "+acao); // receive the correct value
either in Java 6 and Java 7: "avancar"
BeanUtils.populate(bean, request.getParameterMap()); // doesn't
fill the values when using Java 7, but works well in Java 6.
...
}
When running with Java 6, works fine, attribute is filled. When running
with Java 7 it doesn't. Does Java 7 add anything new in terms of
validator that would be conflicting?
Can anyone tell me what I'm doing wrong?
I have commons-beanutils-1.8.3.jar in WEB-INF/lib, just to be sure...
and I don't have it in $TOMCAT/lib
Thanks,
Edson
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: BeanUtils 1.8.3 not working with Java 7
Posted by Javin Paul <sa...@gmail.com>.
You are not alone, this happens to me in past as well. Computer is always
right :)
On Sun, Jun 2, 2013 at 2:40 AM, Edson Richter <ed...@hotmail.com>wrote:
> Forget it. I had old class versions of my own classes in WEB-INF/classes,
> that conflicted with current code.
> I just made a "Clean & Build" (using NetBeans), stopped Tomcat, deployed
> again and it runs fine.
> Reflection sometimes just lead us to strange ways. I though I was getting
> crazy...
>
> Regards,
>
> Edson
>
> Em 01/06/2013 14:42, Edson Richter escreveu:
>
> Forgive me: request.getParameterMap() is coming with all parameter, but
>> values are all empty (in both Java versions).
>>
>> request.getParameter("acao") -> returns "avancar"
>> request.getParameterMap().get(**"acao") -> returns ""
>>
>> I don't know why, but I'll have to do a deeper investigation.
>> If anyone had this issue in the past, I'll appreciate to ear your advices.
>>
>> Regards,
>>
>> Edson
>>
>>
>> Em 01/06/2013 14:07, Edson Richter escreveu:
>>
>>> Dear friends,
>>>
>>> I've searched everywhere and could not find the source for this problem.
>>>
>>> When running my application with Java 6, it works as expected.
>>> When running with Java 7, I get no content.
>>>
>>> Example:
>>>
>>> in html, I have:
>>>
>>> <form ...>
>>> <input type='text' name='acao' value='avancar'>
>>> <input type='text' name='informacoes.documento' value='12345678'>
>>> </form>
>>>
>>> The bean is declared with setter and getters as follows:
>>>
>>> public class MyBean implements Serializable {
>>> private String acao;
>>> private Informacoes informacoes = new Informacoes();
>>> public MyBeans() {}
>>> public String getAcao() { return acao; }
>>> public void setAcao(String acao) { this.acao = acao; }
>>> public Informacoes getInformacoes() { return this.informacoes; }
>>> public void setInformacoes(Informacoes info) { this.informacoes =
>>> informacoes; }
>>> }
>>>
>>> public class Informacoes implements Serializable {
>>> private String documento;
>>> public Informacoes() {}
>>> public String getDocumento() { return this.documento; }
>>> public void setDocumento(String doc) { this.documento = doc; }
>>> }
>>>
>>> My servlet make the following call:
>>>
>>> protected void processRequest(**HttpServletRequest request,
>>> HttpServletResponse response)
>>> throws ServletException, IOException {
>>> String acao = request.getParameter("acao");
>>> System.out.println("Acao = "+acao); // receive the correct value
>>> either in Java 6 and Java 7: "avancar"
>>>
>>> BeanUtils.populate(bean, request.getParameterMap()); // doesn't fill
>>> the values when using Java 7, but works well in Java 6.
>>> ...
>>> }
>>>
>>> When running with Java 6, works fine, attribute is filled. When running
>>> with Java 7 it doesn't. Does Java 7 add anything new in terms of validator
>>> that would be conflicting?
>>> Can anyone tell me what I'm doing wrong?
>>> I have commons-beanutils-1.8.3.jar in WEB-INF/lib, just to be sure...
>>> and I don't have it in $TOMCAT/lib
>>>
>>> Thanks,
>>>
>>> Edson
>>>
>>> ------------------------------**------------------------------**
>>> ---------
>>> To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org<us...@commons.apache.org>
>>> For additional commands, e-mail: user-help@commons.apache.org
>>>
>>>
>>>
>>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org<us...@commons.apache.org>
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: user-unsubscribe@commons.**apache.org<us...@commons.apache.org>
> For additional commands, e-mail: user-help@commons.apache.org
>
>
--
Thanks
Javin
http://javarevisited.blogspot.com/
Twitter : https://twitter.com/javinpaul
Re: BeanUtils 1.8.3 not working with Java 7
Posted by Edson Richter <ed...@hotmail.com>.
Forget it. I had old class versions of my own classes in
WEB-INF/classes, that conflicted with current code.
I just made a "Clean & Build" (using NetBeans), stopped Tomcat, deployed
again and it runs fine.
Reflection sometimes just lead us to strange ways. I though I was
getting crazy...
Regards,
Edson
Em 01/06/2013 14:42, Edson Richter escreveu:
> Forgive me: request.getParameterMap() is coming with all parameter,
> but values are all empty (in both Java versions).
>
> request.getParameter("acao") -> returns "avancar"
> request.getParameterMap().get("acao") -> returns ""
>
> I don't know why, but I'll have to do a deeper investigation.
> If anyone had this issue in the past, I'll appreciate to ear your
> advices.
>
> Regards,
>
> Edson
>
>
> Em 01/06/2013 14:07, Edson Richter escreveu:
>> Dear friends,
>>
>> I've searched everywhere and could not find the source for this problem.
>>
>> When running my application with Java 6, it works as expected.
>> When running with Java 7, I get no content.
>>
>> Example:
>>
>> in html, I have:
>>
>> <form ...>
>> <input type='text' name='acao' value='avancar'>
>> <input type='text' name='informacoes.documento' value='12345678'>
>> </form>
>>
>> The bean is declared with setter and getters as follows:
>>
>> public class MyBean implements Serializable {
>> private String acao;
>> private Informacoes informacoes = new Informacoes();
>> public MyBeans() {}
>> public String getAcao() { return acao; }
>> public void setAcao(String acao) { this.acao = acao; }
>> public Informacoes getInformacoes() { return this.informacoes; }
>> public void setInformacoes(Informacoes info) { this.informacoes =
>> informacoes; }
>> }
>>
>> public class Informacoes implements Serializable {
>> private String documento;
>> public Informacoes() {}
>> public String getDocumento() { return this.documento; }
>> public void setDocumento(String doc) { this.documento = doc; }
>> }
>>
>> My servlet make the following call:
>>
>> protected void processRequest(HttpServletRequest request,
>> HttpServletResponse response)
>> throws ServletException, IOException {
>> String acao = request.getParameter("acao");
>> System.out.println("Acao = "+acao); // receive the correct value
>> either in Java 6 and Java 7: "avancar"
>>
>> BeanUtils.populate(bean, request.getParameterMap()); // doesn't
>> fill the values when using Java 7, but works well in Java 6.
>> ...
>> }
>>
>> When running with Java 6, works fine, attribute is filled. When
>> running with Java 7 it doesn't. Does Java 7 add anything new in terms
>> of validator that would be conflicting?
>> Can anyone tell me what I'm doing wrong?
>> I have commons-beanutils-1.8.3.jar in WEB-INF/lib, just to be sure...
>> and I don't have it in $TOMCAT/lib
>>
>> Thanks,
>>
>> Edson
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
>> For additional commands, e-mail: user-help@commons.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: BeanUtils 1.8.3 not working with Java 7
Posted by Edson Richter <ed...@hotmail.com>.
Forgive me: request.getParameterMap() is coming with all parameter, but
values are all empty (in both Java versions).
request.getParameter("acao") -> returns "avancar"
request.getParameterMap().get("acao") -> returns ""
I don't know why, but I'll have to do a deeper investigation.
If anyone had this issue in the past, I'll appreciate to ear your advices.
Regards,
Edson
Em 01/06/2013 14:07, Edson Richter escreveu:
> Dear friends,
>
> I've searched everywhere and could not find the source for this problem.
>
> When running my application with Java 6, it works as expected.
> When running with Java 7, I get no content.
>
> Example:
>
> in html, I have:
>
> <form ...>
> <input type='text' name='acao' value='avancar'>
> <input type='text' name='informacoes.documento' value='12345678'>
> </form>
>
> The bean is declared with setter and getters as follows:
>
> public class MyBean implements Serializable {
> private String acao;
> private Informacoes informacoes = new Informacoes();
> public MyBeans() {}
> public String getAcao() { return acao; }
> public void setAcao(String acao) { this.acao = acao; }
> public Informacoes getInformacoes() { return this.informacoes; }
> public void setInformacoes(Informacoes info) { this.informacoes =
> informacoes; }
> }
>
> public class Informacoes implements Serializable {
> private String documento;
> public Informacoes() {}
> public String getDocumento() { return this.documento; }
> public void setDocumento(String doc) { this.documento = doc; }
> }
>
> My servlet make the following call:
>
> protected void processRequest(HttpServletRequest request,
> HttpServletResponse response)
> throws ServletException, IOException {
> String acao = request.getParameter("acao");
> System.out.println("Acao = "+acao); // receive the correct value
> either in Java 6 and Java 7: "avancar"
>
> BeanUtils.populate(bean, request.getParameterMap()); // doesn't
> fill the values when using Java 7, but works well in Java 6.
> ...
> }
>
> When running with Java 6, works fine, attribute is filled. When
> running with Java 7 it doesn't. Does Java 7 add anything new in terms
> of validator that would be conflicting?
> Can anyone tell me what I'm doing wrong?
> I have commons-beanutils-1.8.3.jar in WEB-INF/lib, just to be sure...
> and I don't have it in $TOMCAT/lib
>
> Thanks,
>
> Edson
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org