struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Gunnar.Bost...@tietoenator.com>
Subject SV: SV: Ognl versions
Date Tue, 07 Oct 2008 14:40:37 GMT
Hi,
We have a measureList that looks the same and it works!
   public SortedMap<Integer, String> getMeasureList() {

        // man = Ärenden som skall konfigureras manuellt
        // uttagen = Ärenden som skall klarrapporteras efter manuell konfigurering
        measureList.put(1, "Ärenden som skall konfigureras manuellt");
        measureList.put(2, "Ärenden som skall klarrapporteras efter manuell konfigurering");

        return measureList;
    }

		<tr><td><s:select
			name="searchJobVO.measure"
			label="Åtgärd"
			required="false"
			headerKey="-1"
			headerValue="Alla"
			list="measureList"
		/></td></tr>

/Gunnar
 

> -----Ursprungligt meddelande-----
> Från: Chris Pratt [mailto:thechrispratt@gmail.com] 
> Skickat: den 7 oktober 2008 09:15
> Till: Struts Users Mailing List
> Ämne: Re: SV: Ognl versions
> 
> Just as an experiment, you might try renaming the method as a 
> true JavaBean method.  Maybe OGNL got more strict on it's 
> interpretation of the spec.
>   (*Chris*)
> 
> On Mon, Oct 6, 2008 at 11:21 PM, 
> <Gunnar.Bostrom@tietoenator.com> wrote:
> 
> > Hi,
> > I mean that the value is null now that I use ognl 2.7.2. When using 
> > 2.6.11 the value is a correct map.
> >
> > This is in the model för the jsp page:
> >    SortedMap<Integer, String> jobTypeList = new TreeMap<Integer, 
> > String>();
> >
> >    public SortedMap<Integer, String> getjobTypeList() {
> >        jobTypeList.put(1, "Förfrågan");
> >        jobTypeList.put(8, "VP-flytt");
> >        // return this.getWc().getTypeAsText();
> >        return jobTypeList;
> >    }
> >
> > /Gunnar
> >
> >
> > > -----Ursprungligt meddelande-----
> > > Från: Dale Newfield [mailto:dale@newfield.org]
> > > Skickat: den 6 oktober 2008 20:34
> > > Till: Bostrom Gunnar
> > > Kopia: user@struts.apache.org
> > > Ämne: Re: SV: Ognl versions
> > >
> > > Gunnar.Bostrom@tietoenator.com wrote:
> > > > The jobTypelist is empty, but it worked with 2.6.11 
> version of ognl.
> > > > The applications is our own.
> > >
> > > So you're saying that the updated version doesn't 
> silently fail, and 
> > > that's enough to condemn it?  I would argue that that's an 
> > > improvement.
> > >
> > > In fact, if you look in the source code for the exception 
> stack you 
> > > provide, this is by design:
> > >
> > > core/src/main/java/org/apache/struts2/components/ListUIBean.java:
> > > >         if (value == null) {
> > > >             if (throwExceptionOnNullValueAttribute) {
> > > >                 // will throw an exception if not found
> > > >                 value = findValue((list == null) ? (String)
> > > list : list.toString(), "list",
> > > >                     "The requested list key '" + list + "'
> > > could not be resolved as a
> > > collection/array/map/enumeration/iterator type. " +
> > > >                     "Example: people or people.{name}");
> > > >             }
> > > >             else {
> > > >                 // ww-1010, allows value with null value to
> > > be compatible with ww
> > > >                 // 2.1.7 behaviour
> > > >                 value = findValue((list == null)?(String)
> > > list:list.toString());
> > > >             }
> > >  >         }
> > >
> > > So, in fact, what you're finding through your testing is a place 
> > > where ognl 2.6.11 is doing the wrong thing.
> > >
> > > If you want silent failure, there's a flag to throw so 
> that your app 
> > > gets it.  If you want to evaluate the correctness of a component, 
> > > please ensure you're testing what you think you're testing.
> > >
> > > -Dale
> > >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message