Re: S2 - Error when I use include in struts.xml
Hello, In the struts2-showcase application, I see the includes in struts.xml working very well. Then, I gone to hack the source code to try understand how this works. My conclusions are: 1) If a package 'A' extends 'struts-default', then it can be put in a file-A.xml ; 2) If a package 'B' extends 'A', then it only can be put in file-A.xml (if I put in file-B.xml, I'll catch a error); 3) If a package 'B' extends 'struts-default', then it can be put in a file-B.xml . I would like to know if my conclusions are right. Anyone else? Thanks, Alexandre Lima - Original Message - From: Alexandre Mendonça Lima [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, January 26, 2007 4:18 PM Subject: S2 - Error when I use include in struts.xml Hello, When I use tag include in my struts.xml, I get a error on startup of my application. My struts.xml file is: struts package name=jsime-default extends=struts-default !-- ommited -- /package include file=struts-controleAcesso.xml/ /struts My struts-controleAcesso.xml is: struts package name=jsime-controleAcesso extends=jsime-default action name=Usuario_* class=embasa.jsime.view.action.controleAcesso.UsuarioAction method={1} result name=success/pages/ControleAcessoUsuarioListagem.jsp/result result name=input/pages/ControleAcessoUsuarioCadastro.jsp/result /action /package /struts The error that I catched in console is: SEVERE: Exception starting filter struts2 Error building results for action Usuario_* in namespace - action - file:/F:/Alexandre/Sistemas/eclipseworkspace/JSIME/WEB-INF/classes/struts-controleAcesso.xml:8:99 Anyone know what is, please? Thanks, Alexandre Lima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2 - Error when I use include in struts.xml
Hello, When I use tag include in my struts.xml, I get a error on startup of my application. My struts.xml file is: struts package name=jsime-default extends=struts-default !-- ommited -- /package include file=struts-controleAcesso.xml/ /struts My struts-controleAcesso.xml is: struts package name=jsime-controleAcesso extends=jsime-default action name=Usuario_* class=embasa.jsime.view.action.controleAcesso.UsuarioAction method={1} result name=success/pages/ControleAcessoUsuarioListagem.jsp/result result name=input/pages/ControleAcessoUsuarioCadastro.jsp/result /action /package /struts The error that I catched in console is: SEVERE: Exception starting filter struts2 Error building results for action Usuario_* in namespace - action - file:/F:/Alexandre/Sistemas/eclipseworkspace/JSIME/WEB-INF/classes/struts-controleAcesso.xml:8:99 Anyone know what is, please? Thanks, Alexandre Lima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [s2] String comparison with OGNL
I see something in the Guide page about this way: s:property value='%{#parameters.addrType == billing}'/ Alexandre Lima - Original Message - From: Wesley Wannemacher [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, January 23, 2007 3:44 PM Subject: RE: [s2] String comparison with OGNL Nope, same result... Here is the code and output - ---CODE p class=sectionSubTitle Please verify the details of your s:property value=#parameters.addrType/ address below - /p s:property value=%{#parameters.addrType == 'billing'}/ ---RESULT p class=sectionSubTitle Please verify the details of your billing address below - /p false I'm not sure how much it matters, but I am working with a snapshot of 2.0.2 that I built a while back. If this is an issue, I can replace any jars to see if that fixes the problem. -Wes -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 23, 2007 1:36 PM To: Struts Users Mailing List Subject: RE: [s2] String comparison with OGNL From: Wesley Wannemacher [mailto:[EMAIL PROTECTED] s:property value=#parameters.addrType == 'billing'/ Does wrapping it with %{} do it? s:property value=%{#parameters.addrType == 'billing'}/ I still get a little confused when dealing with the different markups. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Tag select have problems
Hi everyone, I got last version Struts 2.0.3 today and updated now my application but one page is gone wrong. In this page, I have the code: s:select name=filtroRegiao list=todasRegioes listKey=id listValue=descricao headerKey=-1 headerValue= / My Action class have two atributes: todasRegioes is a java.util.List and filtroRegiao is a java.lang.String. The list todasRegioes have instances from class Regiao which have atributes id and descricao. When I submitted my form to same page for refresh it, the select doesn't show the value selected, always show the value setting in headerKey. Anyone can help me? Alexandre Lima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Tag select have problems
Hi again, I discover debugging my application that the error is in the moment on tag s:select renders it at JSP. I change my code to: s:select name=filtroRegiao list=todasRegioes listKey=id listValue=descricao headerKey=-1 headerValue= value=%{filtroRegiao.toString()}/ and works!!! But in the first time when I enter in the page, filtroRegiao is null and in my console appears: WARNING: Caught an exception while evaluating expression 'filtroRegiao.toString()' against value stack java.lang.NullPointerException: target is null for method toString Anyone have tips for me? Thanks, Alexandre Lima - Original Message - From: Alexandre Mendonça Lima [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, January 22, 2007 9:57 AM Subject: [S2] Tag select have problems Hi everyone, I got last version Struts 2.0.3 today and updated now my application but one page is gone wrong. In this page, I have the code: s:select name=filtroRegiao list=todasRegioes listKey=id listValue=descricao headerKey=-1 headerValue= / My Action class have two atributes: todasRegioes is a java.util.List and filtroRegiao is a java.lang.String. The list todasRegioes have instances from class Regiao which have atributes id and descricao. When I submitted my form to same page for refresh it, the select doesn't show the value selected, always show the value setting in headerKey. Anyone can help me? Alexandre Lima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Tag select have problems
Hi André, The atributte of key field is a Long. Then this is a bug because in previously versions worked. Thanks, Alexandre Lima - Original Message - From: André Faria [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, January 22, 2007 11:23 AM Subject: Re: [S2] Tag select have problems I had the same problem if the key field were a primitive type that works... Like int insted Integer... Alexandre Mendonça Lima escreveu: Hi everyone, I got last version Struts 2.0.3 today and updated now my application but one page is gone wrong. In this page, I have the code: s:select name=filtroRegiao list=todasRegioes listKey=id listValue=descricao headerKey=-1 headerValue= / My Action class have two atributes: todasRegioes is a java.util.List and filtroRegiao is a java.lang.String. The list todasRegioes have instances from class Regiao which have atributes id and descricao. When I submitted my form to same page for refresh it, the select doesn't show the value selected, always show the value setting in headerKey. Anyone can help me? Alexandre Lima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Tag select have problems
I checked in the JIRA and exists a two bugs opened there. https://issues.apache.org/struts/browse/WW-1601 https://issues.apache.org/struts/browse/WW-1634 This is a big limitation for a version that it would be changed in stable version. Regards, Alexandre Lima - Original Message - From: Alexandre Mendonça Lima [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org; [EMAIL PROTECTED] Sent: Monday, January 22, 2007 10:29 AM Subject: Re: [S2] Tag select have problems Hi André, The atributte of key field is a Long. Then this is a bug because in previously versions worked. Thanks, Alexandre Lima - Original Message - From: André Faria [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, January 22, 2007 11:23 AM Subject: Re: [S2] Tag select have problems I had the same problem if the key field were a primitive type that works... Like int insted Integer... Alexandre Mendonça Lima escreveu: Hi everyone, I got last version Struts 2.0.3 today and updated now my application but one page is gone wrong. In this page, I have the code: s:select name=filtroRegiao list=todasRegioes listKey=id listValue=descricao headerKey=-1 headerValue= / My Action class have two atributes: todasRegioes is a java.util.List and filtroRegiao is a java.lang.String. The list todasRegioes have instances from class Regiao which have atributes id and descricao. When I submitted my form to same page for refresh it, the select doesn't show the value selected, always show the value setting in headerKey. Anyone can help me? Alexandre Lima - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Tag select have problems
Thanks Stuart, I'll change my code for anything that works! Regards, Alexandre Lima - Original Message - From: Stuart Piltch [EMAIL PROTECTED] To: user@struts.apache.org Sent: Monday, January 22, 2007 11:05 AM Subject: Re: [S2] Tag select have problems The atributte of key field is a Long. Then this is a bug because in previously versions worked. Hi Alexandre, I believe this is a bug in the current Struts2 code. See https://issues.apache.org/struts/browse/WW-1601 https://issues.apache.org/struts/browse/WW-1634 Basically, the select tag will only pre-select an item if the listKey is a String. We have been using Integers as keys for our pulldowns (a simple Integer--String ArrayList), so we ran into this as well. As a workaround, we added two methods to the business model class. These simply get and set the Integer attribute of the class by converting between String and Integer. As a specific example, below is a snippet from our Address class, which sometimes is used by a County pulldown in a struts2 form. The form element itself looks like this: s:select name=address.countyIdStr headerKey= headerValue=-- Select One-- list=counties listKey=id listValue=name required=true / Cheers, - stuart private Integer id; private Integer city; [...more attributes...] private Integer countyId; public Integer getId() { return id; } public void setId(Integer id) {this.id = id; } public String getCity() { return city; ] public void setCity(String city) { this.city = city; } [... more getters and setters ...] public Integer getCountyId() { return countyId; } public void setCountyId(Integer countyId) { this.countyId = countyId; } /* Helper methods for dealing with preselecting pulldowns in struts2 * See https://issues.apache.org/struts/browse/WW-1601 */ public getCountyIdStr() { return countyId == null ? null : countyId.toString(); } public void setCountyIdStr(String countyIdStr) { if (NumberUtils.isDigits(countyIdStr)) { countyId = new Integer(countyIdStr); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] dropdowndatetimepicker not working
Hi Musachy, I'll try to build version 2.0.3 . Thanks for you help! Alexandre - Original Message - From: Musachy Barroso [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, January 12, 2007 5:01 PM Subject: Re: [S2] dropdowndatetimepicker not working Hi Alexandre, The datepicker tag has been on the move between 2.0.1 - 2.0.3. I would suggest not to use 2.0.2, and wait until the next stable build is released, must likely 2.0.3. If you can't wait, and decide to build from source, and still have the same problem, let us know. regards musachy Alexandre Mendonça Lima wrote: Hi, Previously, when I was using version 2.0.1, my JSP was: s:datepicker name=equipamento.dataCadastro format=#dd/#MM/# value=%{dataEqp}/ The property dataCadastro in bean equipamento (property of my action) is from type java.util.Date . It's worked! Now, I'm using the actual version that I´ve copied from http://people.apache.org/builds/struts/2.0.2/ . The tag was modified and I change for: s:dropdowndatetimepicker name=equipamento.dataCadastro type=date language=pt-br/ After submit it generates error: Invalid field value for field equipamento.dataCadastro. In my console shows 2 messages: SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'dojo.equipamento.dataCadastro' with value '[Ljava.lang.String;@6adb31' SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'equipamento.dataCadastro' with value '[Ljava.lang.String;@272fec' What's happened? Alexandre Lima from Salvador, Brazil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] dropdowndatetimepicker not working
Hi, Previously, when I was using version 2.0.1, my JSP was: s:datepicker name=equipamento.dataCadastro format=#dd/#MM/# value=%{dataEqp}/ The property dataCadastro in bean equipamento (property of my action) is from type java.util.Date . It's worked! Now, I'm using the actual version that I´ve copied from http://people.apache.org/builds/struts/2.0.2/ . The tag was modified and I change for: s:dropdowndatetimepicker name=equipamento.dataCadastro type=date language=pt-br/ After submit it generates error: Invalid field value for field equipamento.dataCadastro. In my console shows 2 messages: SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'dojo.equipamento.dataCadastro' with value '[Ljava.lang.String;@6adb31' SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception catched: Error setting expression 'equipamento.dataCadastro' with value '[Ljava.lang.String;@272fec' What's happened? Alexandre Lima from Salvador, Brazil