Date: 2004-09-02T03:29:49 Editor: NiallPemberton <[EMAIL PROTECTED]> Wiki: Apache Struts Wiki Page: Struts1.1to1.2.1UpgradeNotes URL: http://wiki.apache.org/struts/Struts1.1to1.2.1UpgradeNotes
no comment Change Log: ------------------------------------------------------------------------------ @@ -1,33 +1,61 @@ -From a posting to the Struts User mailing list from Niall Pemberton += Upgrading Struts 1.1 to Struts 1.2.x = -* jars - I guess its obvious to say you need to replace the jars, but the one people might forget is the new commons-validator.jar for version 1.1.3 of validator. I'm not sure where you can download this from currently, except the Struts 1.2.1 distro includes it. +== jars == -* tlds - remember to deploy the new versions of the tld files for struts tags. If you don't you won't be able to use the new tag attributes added. +I guess its obvious to say you need to replace the jars, but the one people might forget is the new commons-validator.jar for version 1.1.3 of validator. -* validator.xml - change the dtd declaration at the top to refer to the dtd for validator 1.1.3 +Also if you want to start using the new '''validwhen''' validation rule, then you will need to deploy the antlr.jar as well. + +== tlds == +Remember to deploy the new versions of the tld files for struts tags. If you don't you won't be able to use the new tag attributes added. + +'''NOTE''' The uri's in the struts tlds have changed from jakarta.apache.org/struts to struts.apache.org - see section '''1.3 jsp''' below for the implications of this. + +== jsp == +The uri in the Taglib declaration may need to be updated. + +'''A.''' If you have configured the tag libraries using entries in the web.xml (see [http://struts.apache.org/userGuide/configuration.html#dd_config_taglib User Guide]) then you shouldn't need to do anything. + +'''B.''' If you have used the simplified deployment allowed by Servlet 2.3 onwards then (see [http://struts.apache.org/userGuide/configuration.html#dd_config_taglib_23 User Guide]) then you have one of two choices + + '''B.1.''' Change all your jsps to point to the new uri, for example: + + Struts 1.1 {{{ <%@ taglib uri="http://jakarta.apache.org/struts/tags-html prefix="html" %> }}} + + Struts 1.2.x {{{ <%@ taglib uri="http://struts.apache.org/tags-html prefix="html" %> }}} + + '''B.2.''' Add entries in the web.xml for each of the struts tag libraries as shown in the[http://struts.apache.org/userGuide/configuration.html#dd_config_taglib User Guide]. + +== validator.xml == +Change the dtd declaration at the top to refer to the dtd for validator 1.1.3 <!DOCTYPE form-validation PUBLIC "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN" "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd"> -* validator-rules.xml - upgrade to the new version of validator-rules.xml. In the Struts 1.2.1 version the dtd declaration in validator-rules.xml is incorrect - its right in the latest nightly build - either use that or just change the dtd declaration as shown above in the 1.2.1 version of validator-rules.xml. +== validator-rules.xml == +Upgrade to the new version of validator-rules.xml. -* struts-config.xml - its not absolutely necessary but you should upgrade to the 1.2 version of the dtd (Note that as well as the version number changing so has the url to struts.apache.org). +== struts-config.xml == +Its not absolutely necessary but you should upgrade to the 1.2 version of the dtd (Note that as well as the version number changing so has the url to struts.apache.org). <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd"> - If you do upgrade to the 1.2 version dtd then there are a couple of attributes which have been removed and you will need to remove them from your struts-config: - - debug has been removed from the "controller" element. - - dynamic has been removed from the "form-bean" element +If you do upgrade to the 1.2 version dtd then there are a couple of attributes which have been removed and you will need to remove them from your struts-config: + * debug has been removed from the "controller" element. + * dynamic has been removed from the "form-bean" element + +Also the '''''contextRelative''''' attribute in the "forward" element is now considered "deprecated" and a new '''''module''''' attribute added. -Also "contextRelative" in the "forward" element is now considered "deprecated" and a new "module" attribute added. +== ActionError(s) and ActionMessage(s) == +There is some confusion over ActionError and ActionErrors and whats deprecated. -The only other thing I did was change references to ActionError to ActionMessage - its wasn't necessary to do it, but it got rid of the "deprecation" warnings when I compile. +'''A.''' ActionError '''IS''' deprecated and should be replaced by ActionMessage. -* jsp - The uri in the Taglib declaration may need to be updated. - Struts 1.1 {{{ <%@ taglib uri="http://jakarta.apache.org/struts/... %> }}} +'''B.''' ActionErrors '''IS NOT''' deprecated. The Struts committers would have liked to have deprecated ActionErrors but because too much of core API depend on it (such as the ActionForm's validate method) it hasn't been. However it may be in the future and, where possible, you should now use ActionMessages in place of ActionErrors. - Struts 1.2.1 {{{ <%@ taglib uri="http://struts.apache.org/... %> }}} +---- +CategoryHomepage --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
