Author: hrabago Date: Sun Aug 21 16:08:45 2005 New Revision: 234386 URL: http://svn.apache.org/viewcvs?rev=234386&view=rev Log: Removed deprecated class members defaultLocale and getActionErrors(). Remove deprecated tag attributes and references to them: bean:include's name html:html's locale html:img's contextRelative
Modified: struts/taglib/trunk/doc/userGuide/struts-bean.xml struts/taglib/trunk/doc/userGuide/struts-html.xml struts/taglib/trunk/src/java/org/apache/struts/taglib/TagUtils.java struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/IncludeTag.java struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/package.html struts/taglib/trunk/src/java/org/apache/struts/taglib/html/BaseHandlerTag.java struts/taglib/trunk/src/java/org/apache/struts/taglib/html/ErrorsTag.java struts/taglib/trunk/src/java/org/apache/struts/taglib/html/HtmlTag.java struts/taglib/trunk/src/java/org/apache/struts/taglib/html/ImgTag.java struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java struts/taglib/trunk/src/java/org/apache/struts/taglib/html/OptionTag.java struts/taglib/trunk/src/tld/struts-bean.tld struts/taglib/trunk/src/tld/struts-html.tld Modified: struts/taglib/trunk/doc/userGuide/struts-bean.xml URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/doc/userGuide/struts-bean.xml?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/doc/userGuide/struts-bean.xml (original) +++ struts/taglib/trunk/doc/userGuide/struts-bean.xml Sun Aug 21 16:08:45 2005 @@ -433,20 +433,6 @@ </attribute> <attribute> - <name>name</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <info><![CDATA[ - <p>Module-relative name (starting with a '/') of the web application - resource to be dispatched, and whose response data is to be made - available as a bean.</p> - ]]></info> - <deprecated> - Use the "page" attribute instead. - </deprecated> - </attribute> - - <attribute> <name>page</name> <required>false</required> <rtexprvalue>true</rtexprvalue> Modified: struts/taglib/trunk/doc/userGuide/struts-html.xml URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/doc/userGuide/struts-html.xml?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/doc/userGuide/struts-html.xml (original) +++ struts/taglib/trunk/doc/userGuide/struts-html.xml Sun Aug 21 16:08:45 2005 @@ -2558,23 +2558,6 @@ </attribute> <attribute> - <name>locale</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <info><![CDATA[ - <p>Set to <code>true</code> in order to store a Locale in the session based on - the current request's <code>Accept-Language</code> header (if - any) if none has currently been set. This attribute will create a session - if one does not already exist. The lang attribute is rendered with the - appropriate language code.</p> - ]]></info> - <deprecated> - Creating a session is undesirable for apps that don't support them. Use the lang - attribute to achieve the same functionality without creating a session. - </deprecated> - </attribute> - - <attribute> <name>xhtml</name> <required>false</required> <rtexprvalue>true</rtexprvalue> @@ -3119,18 +3102,6 @@ instance to use. If not specified, defaults to the application resources configured for our action servlet.</p> ]]></info> - </attribute> - - <attribute> - <name>contextRelative</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <deprecated>Use module attribute instead; will be removed in a release afer 1.2.0.</deprecated> - <info><![CDATA[ - <p>If set to "true", this "anchors" the image src at the - application context rather than the module context when the - 'page' attribute is used to specify an image path.</p> - ]]></info> </attribute> <attribute> Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/TagUtils.java URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/TagUtils.java?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/java/org/apache/struts/taglib/TagUtils.java (original) +++ struts/taglib/trunk/src/java/org/apache/struts/taglib/TagUtils.java Sun Aug 21 16:08:45 2005 @@ -593,60 +593,6 @@ } /** - * Retrieves the value from request scope and if it isn't already an - * <code>ErrorMessages</code> some classes are converted to one. - * - * @param pageContext The PageContext for the current page - * @param paramName Key for parameter value - * @return ActionErrors from request scope - * @exception JspException - * @deprecated Use getActionMessages() instead. This will be removed - * after Struts 1.2. - */ - public ActionErrors getActionErrors(PageContext pageContext, String paramName) - throws JspException { - - ActionErrors errors = new ActionErrors(); - - Object value = pageContext.findAttribute(paramName); - if (value != null) { - try { - if (value instanceof String) { - errors.add( - ActionMessages.GLOBAL_MESSAGE, - new ActionMessage((String) value)); - - } else if (value instanceof String[]) { - String keys[] = (String[]) value; - for (int i = 0; i < keys.length; i++) { - errors.add( - ActionMessages.GLOBAL_MESSAGE, - new ActionMessage(keys[i])); - } - - } else if (value instanceof ActionErrors) { - errors = (ActionErrors) value; - - } else { - throw new JspException( - messages.getMessage( - "actionErrors.errors", - value.getClass().getName())); - } - - } catch (JspException e) { - throw e; - - } catch (Exception e) { - // this was inconsistent with getActionMessages - // log.debug(e, e); - log.warn("Unable to retieve ActionMessage for paramName : "+paramName,e); - } - } - return errors; - } - - /** * Return the form action converted into an action mapping path. The * value of the <code>action</code> property is manipulated as follows in * computing the name of the requested mapping: Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/IncludeTag.java URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/IncludeTag.java?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/IncludeTag.java (original) +++ struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/IncludeTag.java Sun Aug 21 16:08:45 2005 @@ -115,16 +115,6 @@ MessageResources.getMessageResources("org.apache.struts.taglib.bean.LocalStrings"); /** - * Deprecated method to set the "name" attribute, which has been - * replaced by the "page" attribute. - * - * @deprecated use setPage(String) instead - */ - public void setName(String name) { - this.page = name; - } - - /** * The context-relative URI of the page or servlet to be included. */ protected String page = null; Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java (original) +++ struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/MessageTag.java Sun Aug 21 16:08:45 2005 @@ -18,8 +18,6 @@ package org.apache.struts.taglib.bean; -import java.util.Locale; - import javax.servlet.jsp.JspException; import javax.servlet.jsp.tagext.TagSupport; @@ -116,12 +114,6 @@ public void setBundle(String bundle) { this.bundle = bundle; } - - /** - * The default Locale for our server. - * @deprecated This will be removed after Struts 1.2. - */ - protected static final Locale defaultLocale = Locale.getDefault(); /** * The message key of the message to be retrieved. Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/package.html URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/package.html?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/package.html (original) +++ struts/taglib/trunk/src/java/org/apache/struts/taglib/bean/package.html Sun Aug 21 16:08:45 2005 @@ -339,7 +339,7 @@ request for the include will also include the session identifier (and thus be considered part of the same session).</p> -<pre> <bean:include id="text" name="/generateXml?param1=a&param2=b"/><br></pre> +<pre> <bean:include id="text" page="/generateXml?param1=a&param2=b"/><br></pre> <p><em>Copy A JSP Implicitly Defined Object</em> - You can create a bean that is one of the JSP implicitly defined objects (see the JSP spec for more Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/html/BaseHandlerTag.java URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/html/BaseHandlerTag.java?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/java/org/apache/struts/taglib/html/BaseHandlerTag.java (original) +++ struts/taglib/trunk/src/java/org/apache/struts/taglib/html/BaseHandlerTag.java Sun Aug 21 16:08:45 2005 @@ -54,12 +54,6 @@ // ----------------------------------------------------- Instance Variables /** - * The default Locale for our server. - * @deprecated Use Locale.getDefault() directly. - */ - protected static final Locale defaultLocale = Locale.getDefault(); - - /** * The message resources for this package. */ protected static MessageResources messages = Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/html/ErrorsTag.java URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/html/ErrorsTag.java?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/java/org/apache/struts/taglib/html/ErrorsTag.java (original) +++ struts/taglib/trunk/src/java/org/apache/struts/taglib/html/ErrorsTag.java Sun Aug 21 16:08:45 2005 @@ -70,18 +70,6 @@ } /** - * The default locale on our server. - * @deprecated Use Locale.getDefault() directly. - */ - protected static Locale defaultLocale = Locale.getDefault(); - - /** - * The line ending string. - * @deprecated No longer used. - */ - protected static String lineEnd = System.getProperty("line.separator"); - - /** * The session attribute key for our locale. */ protected String locale = Globals.LOCALE_KEY; Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/html/HtmlTag.java URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/html/HtmlTag.java?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/java/org/apache/struts/taglib/html/HtmlTag.java (original) +++ struts/taglib/trunk/src/java/org/apache/struts/taglib/html/HtmlTag.java Sun Aug 21 16:08:45 2005 @@ -20,8 +20,6 @@ import java.util.Locale; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; import javax.servlet.jsp.JspException; import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.TagSupport; @@ -50,26 +48,6 @@ /** - * Should we set the current Locale for this user if needed? - * @deprecated This will be removed after Struts 1.2. - */ - protected boolean locale = false; - - /** - * @deprecated This will be removed after Struts 1.2. - */ - public boolean getLocale() { - return (locale); - } - - /** - * @deprecated This will be removed after Struts 1.2. - */ - public void setLocale(boolean locale) { - this.locale = locale; - } - - /** * Are we rendering an xhtml page? */ protected boolean xhtml = false; @@ -126,16 +104,11 @@ String language = null; String country = ""; - if (this.locale) { - // provided for 1.1 backward compatibility, remove after 1.2 - language = this.getCurrentLocale().getLanguage(); - } else { - Locale currentLocale = - TagUtils.getInstance().getUserLocale(pageContext, Globals.LOCALE_KEY); + Locale currentLocale = + TagUtils.getInstance().getUserLocale(pageContext, Globals.LOCALE_KEY); - language = currentLocale.getLanguage(); - country = currentLocale.getCountry(); - } + language = currentLocale.getLanguage(); + country = currentLocale.getCountry(); boolean validLanguage = ((language != null) && (language.length() > 0)); boolean validCountry = country.length() > 0; @@ -149,7 +122,7 @@ sb.append(" xmlns=\"http://www.w3.org/1999/xhtml\""); } - if ((this.lang || this.locale || this.xhtml) && validLanguage) { + if ((this.lang || this.xhtml) && validLanguage) { sb.append(" lang=\""); sb.append(language); if (validCountry) { @@ -193,36 +166,9 @@ * Release any acquired resources. */ public void release() { - this.locale = false; this.xhtml = false; this.lang=false; } - - - // ------------------------------------------------------ Protected Methods - - - /** - * Return the current Locale for this request. If there is no locale in the session and - * the locale attribute is set to "true", this method will create a Locale based on the - * client's Accept-Language header or the server's default locale and store it in the - * session. This will always return a Locale and never null. - * @since Struts 1.1 - * @deprecated This will be removed after Struts 1.2. - */ - protected Locale getCurrentLocale() { - - Locale userLocale = TagUtils.getInstance().getUserLocale(pageContext, Globals.LOCALE_KEY); - - // Store a new current Locale, if requested - if (this.locale) { - HttpSession session = ((HttpServletRequest) this.pageContext.getRequest()).getSession(); - session.setAttribute(Globals.LOCALE_KEY, userLocale); - } - - return userLocale; - } - } Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/html/ImgTag.java URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/html/ImgTag.java?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/java/org/apache/struts/taglib/html/ImgTag.java (original) +++ struts/taglib/trunk/src/java/org/apache/struts/taglib/html/ImgTag.java Sun Aug 21 16:08:45 2005 @@ -80,38 +80,6 @@ } /** - * The property to specify how to root the image. - * If 'true' or if there is no current module the image is - * rooted to the application context path - * If 'false' or absent the image is rooted to the current - * module's context path. - * @deprecated Use module property instead; will be removed in a release after 1.2.0. - */ - protected String contextRelative = null; - - /** @deprecated Use module property instead; will be removed in a release after 1.2.0. - */ - public String getContextRelative() { - return (this.contextRelative); - } - - /** @deprecated Use module property instead; will be removed in a release after 1.2.0. - */ - public void setContextRelative(String contextRelative) { - this.contextRelative = contextRelative; - } - - - /** - * Convenience method to return true if contextRelative set to "true". - * @return True if contextRelative set to "true" - * @deprecated Use module property instead; will be removed in a release after 1.2.0. - */ - public boolean isContextRelativeSet() { - return Boolean.valueOf(this.contextRelative).booleanValue(); - } - - /** * The image height. */ protected String height = null; @@ -511,13 +479,12 @@ } /** - * Convenience method to test whether this is the default module - * or if contestRelative has been set. + * Convenience method to test whether this is the default module. * @param config Our Moduleconfig * @return True if this is the default module or contextRelative is set */ private boolean srcDefaultReference(ModuleConfig config) { - return (config == null || isContextRelativeSet()); + return (config == null); } /** @@ -579,7 +546,7 @@ if ((this.src != null) || (this.srcKey != null)) { throwImgTagSrcException(); } - return TagUtils.getInstance().getActionMappingURL(action, module, pageContext, isContextRelativeSet()); + return TagUtils.getInstance().getActionMappingURL(action, module, pageContext, false); } // Deal with an absolute source that has been specified Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java (original) +++ struts/taglib/trunk/src/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java Sun Aug 21 16:08:45 2005 @@ -108,12 +108,6 @@ protected String bundle = Globals.MESSAGES_KEY; /** - * The default locale on our server. - * @deprecated This variable is no longer used. - */ - protected static Locale defaultLocale = Locale.getDefault(); - - /** * The name of the form that corresponds with the action name * in struts-config.xml. Specifying a form name places a * <script> </script> around the javascript. Modified: struts/taglib/trunk/src/java/org/apache/struts/taglib/html/OptionTag.java URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/java/org/apache/struts/taglib/html/OptionTag.java?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/java/org/apache/struts/taglib/html/OptionTag.java (original) +++ struts/taglib/trunk/src/java/org/apache/struts/taglib/html/OptionTag.java Sun Aug 21 16:08:45 2005 @@ -39,12 +39,6 @@ // ----------------------------------------------------- Instance Variables /** - * The default locale for our server. - * @deprecated Use Locale.getDefault() directly. - */ - protected static final Locale defaultLocale = Locale.getDefault(); - - /** * The message resources for this package. */ protected static MessageResources messages = Modified: struts/taglib/trunk/src/tld/struts-bean.tld URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/tld/struts-bean.tld?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/tld/struts-bean.tld (original) +++ struts/taglib/trunk/src/tld/struts-bean.tld Sun Aug 21 16:08:45 2005 @@ -430,18 +430,6 @@ </description> </attribute> <attribute> - <name>name</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <description> - <![CDATA[ - <p>Module-relative name (starting with a '/') of the web application - resource to be dispatched, and whose response data is to be made - available as a bean.</p> - ]]> - </description> - </attribute> - <attribute> <name>page</name> <required>false</required> <rtexprvalue>true</rtexprvalue> Modified: struts/taglib/trunk/src/tld/struts-html.tld URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/src/tld/struts-html.tld?rev=234386&r1=234385&r2=234386&view=diff ============================================================================== --- struts/taglib/trunk/src/tld/struts-html.tld (original) +++ struts/taglib/trunk/src/tld/struts-html.tld Sun Aug 21 16:08:45 2005 @@ -2796,20 +2796,6 @@ </description> </attribute> <attribute> - <name>locale</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <description> - <![CDATA[ - <p>Set to <code>true</code> in order to store a Locale in the session based on - the current request's <code>Accept-Language</code> header (if - any) if none has currently been set. This attribute will create a session - if one does not already exist. The lang attribute is rendered with the - appropriate language code.</p> - ]]> - </description> - </attribute> - <attribute> <name>xhtml</name> <required>false</required> <rtexprvalue>true</rtexprvalue> @@ -3393,18 +3379,6 @@ application resources configured for our action servlet.</p> ]]> </description> - </attribute> - <attribute> - <name>contextRelative</name> - <required>false</required> - <rtexprvalue>true</rtexprvalue> - <description> - <![CDATA[ - <p>If set to "true", this "anchors" the image src at the - application context rather than the module context when the - 'page' attribute is used to specify an image path.</p> - ]]> - </description> </attribute> <attribute> <name>height</name> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]