You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Matt Raible <ma...@raibledesigns.com> on 2003/10/20 19:35:29 UTC

Upgrading from 1.1 to Nightly Build

I upgraded from 1.1 to last night's build and discovered a whole bunch  
of steps needed to upgrade.

http://tinyurl.com/rmai

I ended up with 3 issues in the end.  They are as follows:

1. org.apache.struts.tiles.Controller requires you to implement both  
execute and perform - even though perform is deprecated.

2. org.apache.lang.math.NumberUtils.stringToInt(String) has been  
deprecated according to the compiler.  Not according to its javadocs  
(http://tinyurl.com/rmci)

3.  ValidatorForm.getFieldMap() is deprecated, and there's no signs  
that a replacement exists.

     [javac]  
/Users/mraible/dev/appfuse/src/web/org/appfuse/webapp/action/ 
UserCounterController.java:
53: warning:  
perform(org.apache.struts.tiles.ComponentContext,javax.servlet.http.Http 
ServletRequest,
javax.servlet.http.HttpServletResponse,javax.servlet.ServletContext) in  
org.apache.struts.tiles.Cont
roller has been deprecated
     [javac]     public void perform(ComponentContext tilesContext,
     [javac]                 ^
     [javac]  
/Users/mraible/dev/appfuse/src/web/org/appfuse/webapp/filter/ 
BreadCrumbFilter.java:182:
warning: stringToInt(java.lang.String) in  
org.apache.commons.lang.math.NumberUtils has been deprecat
ed
     [javac]             int mSS = NumberUtils.stringToInt(temp);
     [javac]                                  ^
     [javac]  
/Users/mraible/dev/appfuse/src/web/org/appfuse/webapp/taglib/ 
LabelTag.java:71: warning:
getFieldMap() in org.apache.commons.validator.Form has been deprecated
     [javac]                 Field field = (Field)  
form.getFieldMap().get(fieldName);
     [javac]                                           ^
     [javac] 3 warnings

Any help is appreciated.

Matt


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


Re: Upgrading from 1.1 to Nightly Build

Posted by Matt Raible <ma...@raibledesigns.com>.
Thanks Steve - all your solutions worked!.

Thanks,

Matt

On Monday, October 20, 2003, at 12:52 PM, Steve Raeburn wrote:

>
>
>> -----Original Message-----
>> From: Matt Raible [mailto:matt@raibledesigns.com]
>> Sent: October 20, 2003 10:35 AM
>> To: struts-dev@jakarta.apache.org
>> Subject: Upgrading from 1.1 to Nightly Build
>>
>>
>> I upgraded from 1.1 to last night's build and discovered a whole bunch
>> of steps needed to upgrade.
>>
>> http://tinyurl.com/rmai
>>
>> I ended up with 3 issues in the end.  They are as follows:
>>
>> 1. org.apache.struts.tiles.Controller requires you to implement both
>> execute and perform - even though perform is deprecated.
>
> That's because it's an interface and you *have* to implement the 
> interface
> methods. Can you not just extend ControllerSupport? It implements both
> methods but the default behaviour for perform is just to call execute,
> saving you the need to implement it yourself. (This is the same way 
> that
> Action was modified).
>
>> 2. org.apache.lang.math.NumberUtils.stringToInt(String) has been
>> deprecated according to the compiler.  Not according to its javadocs
>> (http://tinyurl.com/rmci)
>
> The JavaDoc on the website doesn't neccessarily reflect the latest 
> source.
> The CVS version has it deprecated:
>
>      * @deprecated Use {@link #toInt(String)}
>      *  This method will be removed in Commons Lang 3.0
>      */
>     public static int stringToInt(String str) {
>         return toInt(str);
>     }
>
>> 3.  ValidatorForm.getFieldMap() is deprecated, and there's no signs
>> that a replacement exists.
>
> Again, the online Javadoc may not reflect the latest source. From CVS
> version:
>
>     /**
>      * The <code>Field</code>s are returned as an unmodifiable
> <code>Map</code>.
>      * @deprecated Use containsField(String) and getField(String) 
> instead.
>      */
>     public Map getFieldMap() {
>         return Collections.unmodifiableMap(hFields);
>     }
>
> HTH
>
> Steve
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-dev-help@jakarta.apache.org


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


RE: Upgrading from 1.1 to Nightly Build

Posted by Steve Raeburn <sr...@apache.org>.

> -----Original Message-----
> From: Matt Raible [mailto:matt@raibledesigns.com]
> Sent: October 20, 2003 10:35 AM
> To: struts-dev@jakarta.apache.org
> Subject: Upgrading from 1.1 to Nightly Build
>
>
> I upgraded from 1.1 to last night's build and discovered a whole bunch
> of steps needed to upgrade.
>
> http://tinyurl.com/rmai
>
> I ended up with 3 issues in the end.  They are as follows:
>
> 1. org.apache.struts.tiles.Controller requires you to implement both
> execute and perform - even though perform is deprecated.

That's because it's an interface and you *have* to implement the interface
methods. Can you not just extend ControllerSupport? It implements both
methods but the default behaviour for perform is just to call execute,
saving you the need to implement it yourself. (This is the same way that
Action was modified).

> 2. org.apache.lang.math.NumberUtils.stringToInt(String) has been
> deprecated according to the compiler.  Not according to its javadocs
> (http://tinyurl.com/rmci)

The JavaDoc on the website doesn't neccessarily reflect the latest source.
The CVS version has it deprecated:

     * @deprecated Use {@link #toInt(String)}
     *  This method will be removed in Commons Lang 3.0
     */
    public static int stringToInt(String str) {
        return toInt(str);
    }

> 3.  ValidatorForm.getFieldMap() is deprecated, and there's no signs
> that a replacement exists.

Again, the online Javadoc may not reflect the latest source. From CVS
version:

    /**
     * The <code>Field</code>s are returned as an unmodifiable
<code>Map</code>.
     * @deprecated Use containsField(String) and getField(String) instead.
     */
    public Map getFieldMap() {
        return Collections.unmodifiableMap(hFields);
    }

HTH

Steve



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