Matt RaibleMatt Raible is a Java Champion and Developer Advocate at Okta. developer.okta.com

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Upgrading from Struts 1.1 to Nightly build

I'm upgrading our application at work to the nightly build (20031020) of Struts in order to use the validwhen Validator. I found a few deprecations and errors in the process, so I thought I'd share to help others upgrade easier:

  • ActionError has been deprecated in favor of ActionMessage. Likewise, ActionMessages.GLOBAL_MESSAGE replaces ActionErrors.GLOBAL_ERROR.
  • Methods in ResponseUtils have been deprecated in favor of TagUtils' methods.
  • RequestUtils.message has been deprecated in favor of TagUtils.message. Other methods include RequestUtils.lookup.
  • Many of the methods in TagUtils aren't static (they where were in Request/ResponseUtils), so you have to create an instance of TagUtils. Anyone know the logic here?
  • ValidatorResources.get deprecated in favor of ValidatorResources.getForm.
  • ValidatorForm.getFieldMap() is gone, which no apparent replacement method (at least not in the JavaDocs).
  • The Tiles' Controller interface's perform method has been deprecated in favor of execute. You gotta love this one - while perform has been deprecated, you must use it or you will get a compile error saying you must implement it (or declare your class abstract). Same goes for execute. So to upgrade, I had to implement both methods - where my perform method calls my execute method.
  • org.apache.commons.lang.NumberUtils moved to org.apache.commons.lang.math.NumberUtils
  • org.apache.commons.validator.ValidatorUtil moved to org.apache.commons.validator.util.ValidatorUtils
  • stringToInt(java.lang.String) in org.apache.commons.lang.math.NumberUtils has been deprecated. Not according to the its JavaDoc.

Final tally - two deprecation errors that don't seem to have replacements (yet):

    [javac] .../src/web/org/appfuse/webapp/filter/BreadCrumbFilter.java:182: 
        warning: stringToInt(java.lang.String) in 
        org.apache.commons.lang.math.NumberUtils has been deprecated                                                                                                  
    [javac]        int mSS = NumberUtils.stringToInt(temp);                                    
    [javac]                                  ^                                                      
    [javac] .../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);               

Later: Thanks to Steve Raeburn (via the struts-dev mailing list), I now have no deprecation errors. NumberUtils.stringToInt(String) is now NumberUtils.toInt(String) and Form.getFieldMap().get(String) is now Form.getField(String). Thanks Steve!

Posted in Java at Oct 20 2003, 10:22:00 AM MDT 2 Comments
Comments:

Regarding TilesController: you should rather use ControllerSupport to be able to override just the method you desire (execute | perform), see http://jakarta.apache.org/struts/api/org/apache/struts/tiles/ControllerSupport.html Cheers, Yann

Posted by Yann Cebron on October 20, 2003 at 11:59 AM MDT #

(ActionError has been deprecated), Has <html:message> tag will also be updated to help us differentiate between Messages and errors.

Posted by Jason W on October 21, 2003 at 07:01 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed