svn commit: r893915 - in /struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html: BaseHandlerTag.java BaseTag.java FormTag.java MultiboxTag.java OptionTag.java Op
Author: pbenedict Date: Sat Dec 26 00:48:32 2009 New Revision: 893915 URL: http://svn.apache.org/viewvc?rev=893915&view=rev Log: STR-3191: Undo r815660 against 1.3 Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/BaseTag.java struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/MultiboxTag.java struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/OptionsCollectionTag.java struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/OptionsTag.java Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java?rev=893915&r1=893914&r2=893915&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java Sat Dec 26 00:48:32 2009 @@ -913,7 +913,7 @@ protected void prepareIndex(StringBuffer handlers, String name) throws JspException { if (name != null) { -handlers.append(TagUtils.getInstance().filter(name)); +handlers.append(name); } handlers.append("["); @@ -1156,9 +1156,9 @@ Object value) { if (value != null) { handlers.append(" "); -handlers.append(TagUtils.getInstance().filter(name)); +handlers.append(name); handlers.append("=\""); -handlers.append(TagUtils.getInstance().filter(value.toString())); +handlers.append(value); handlers.append("\""); } } @@ -1221,5 +1221,4 @@ property, beanName)); } } - } Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/BaseTag.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/BaseTag.java?rev=893915&r1=893914&r2=893915&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/BaseTag.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/BaseTag.java Sat Dec 26 00:48:32 2009 @@ -177,20 +177,18 @@ .getContextPath()); contextBase.append("/"); -tag.append(TagUtils.getInstance().filter( -RequestUtils.createServerUriStringBuffer(scheme, -serverName, port, contextBase.toString()).toString())); +tag.append(RequestUtils.createServerUriStringBuffer(scheme, +serverName, port, contextBase.toString()).toString()); } else { -tag.append(TagUtils.getInstance().filter( -RequestUtils.createServerUriStringBuffer(scheme, -serverName, port, uri).toString())); +tag.append(RequestUtils.createServerUriStringBuffer(scheme, +serverName, port, uri).toString()); } tag.append("\""); if (this.target != null) { tag.append(" target=\""); -tag.append(TagUtils.getInstance().filter(this.target)); +tag.append(this.target); tag.append("\""); } Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java?rev=893915&r1=893914&r2=893915&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Sat Dec 26 00:48:32 2009 @@ -608,10 +608,9 @@ (HttpServletResponse) this.pageConte
svn commit: r551064 - /struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java
Author: pbenedict Date: Tue Jun 26 23:01:14 2007 New Revision: 551064 URL: http://svn.apache.org/viewvc?view=rev&rev=551064 Log: STR-1175: Fix javadoc Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java?view=diff&rev=551064&r1=551063&r2=551064 == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java Tue Jun 26 23:01:14 2007 @@ -30,8 +30,8 @@ import javax.servlet.jsp.tagext.TagSupport; /** - * This tag tells all other html taglib tags to render themselves in xhtml. It - * has no attributes; it's presence in a page turns on xhtml. + * This tag tells all other html taglib tags to render themselves in xhtml. + * Its presence in a page turns on xhtml. * Example: <html:xhtml/> */ public class XhtmlTag extends TagSupport {
svn commit: r551067 - /struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java
Author: pbenedict Date: Tue Jun 26 23:05:09 2007 New Revision: 551067 URL: http://svn.apache.org/viewvc?view=rev&rev=551067 Log: STR-1175: Add instance qualification Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java?view=diff&rev=551067&r1=551066&r2=551067 == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/XhtmlTag.java Tue Jun 26 23:05:09 2007 @@ -59,8 +59,8 @@ public int doEndTag() throws JspException { int inScope = PageContext.PAGE_SCOPE; try { -if (scope != null) { -inScope = TagUtils.getInstance().getScope(scope); +if (this.scope != null) { +inScope = TagUtils.getInstance().getScope(this.scope); } } catch (JspException e) { log.warn("invalid scope name - defaulting to PAGE_SCOPE", e);
svn commit: r551442 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java
Author: pbenedict Date: Wed Jun 27 21:31:58 2007 New Revision: 551442 URL: http://svn.apache.org/viewvc?view=rev&rev=551442 Log: STR-286: Fix @since tags for this issue Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java?view=diff&rev=551442&r1=551441&r2=551442 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java Wed Jun 27 21:31:58 2007 @@ -84,7 +84,7 @@ * @param actionConfig action config for current request * @return true if action form should be populated * - * @since Struts 1.3.7 + * @since Struts 1.4 */ protected boolean isPopulate(HttpServletRequest request, ActionConfig actionConfig) { String strPopulate = actionConfig.getPopulate(); @@ -97,7 +97,7 @@ * @param actionConfig action config for current request * @return true if action form should be reset * - * @since Struts 1.3.7 + * @since Struts 1.4 */ protected boolean isReset(HttpServletRequest request, ActionConfig actionConfig) { String strReset = actionConfig.getReset(); @@ -114,7 +114,7 @@ * corresponding action form; false if if action mapping is * configured not to reset (or populate) the action form. * - * @since Struts 1.3.7 + * @since Struts 1.4 */ protected boolean getResetOrPopulate(HttpServletRequest request, String strAttr) { // Reset configuration is not defined (should not happen,
svn commit: r551789 - in /struts/struts1/trunk/taglib/src/main: java/org/apache/struts/taglib/html/OptionTag.java resources/META-INF/tld/struts-html.tld
Author: pbenedict Date: Thu Jun 28 21:10:55 2007 New Revision: 551789 URL: http://svn.apache.org/viewvc?view=rev&rev=551789 Log: STR-2072: Add title and titleKey Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java?view=diff&rev=551789&r1=551788&r2=551789 == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionTag.java Thu Jun 28 21:10:55 2007 @@ -107,6 +107,16 @@ private String dir = null; /** + * The advisory title of this element. + */ +private String title = null; + +/** + * The message resources key of the advisory title. + */ +private String titleKey = null; + +/** * The server value for this option, also used to match against the * current property value to determine whether this option should be * marked as selected. @@ -229,6 +239,42 @@ this.dir = dir; } +/** + * Returns the advisory title attribute. + * + * @since Struts 1.4 + */ +public String getTitle() { +return title; +} + +/** + * Sets the advisory title attribute. + * + * @since Struts 1.4 + */ +public void setTitle(String title) { +this.title = title; +} + +/** + * Returns the message resources key of the advisory title. + * + * @since Struts 1.4 + */ +public String getTitleKey() { +return titleKey; +} + +/** + * Sets the message resources key of the advisory title. + * + * @since Struts 1.4 + */ +public void setTitleKey(String titleKey) { +this.titleKey = titleKey; +} + // - Public Methods /** @@ -332,6 +378,12 @@ results.append("\""); } +if (title != null || titleKey != null) { +results.append(" title=\""); +results.append(message(title, titleKey)); +results.append("\""); +} + results.append(">"); results.append(text()); @@ -376,10 +428,42 @@ style = null; styleClass = null; text = null; +title = null; +titleKey = null; value = null; } // -- Protected Methods + +/** + * Return the text specified by the literal value or the message resources + * key, if any; otherwise return null. + * + * @param literal Literal text value or null + * @param key Message resources key or null + * @throws JspException if both arguments are non-null + */ +protected String message(String literal, String key) +throws JspException { +if (literal != null) { +if (key != null) { +JspException e = +new JspException(messages.getMessage("common.both")); + +TagUtils.getInstance().saveException(pageContext, e); +throw e; +} else { +return (literal); +} +} else { +if (key != null) { +return TagUtils.getInstance().message(pageContext, getBundle(), +getLocale(), key); +} else { +return null; +} +} +} /** * Return the text to be displayed to the user for this option (if any). Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld?view=diff&rev=551789&r1=551788&r2=551789 == --- struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld (original) +++ struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Thu Jun 28 21:10:55 2007 @@ -5973,6 +5973,31 @@ +title +false +true + + + + + +titleKey +false +true + + + + + value true true
svn commit: r551790 - in /struts/struts1/trunk/el/src/main: java/org/apache/strutsel/taglib/html/ELOptionTag.java resources/META-INF/tld/struts-html-el.tld
Author: pbenedict Date: Thu Jun 28 21:17:37 2007 New Revision: 551790 URL: http://svn.apache.org/viewvc?view=rev&rev=551790 Log: STR-2072: Add title and titleKey (EL version) Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java?view=diff&rev=551790&r1=551789&r2=551790 == --- struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java (original) +++ struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java Thu Jun 28 21:17:37 2007 @@ -98,6 +98,18 @@ private String styleIdExpr; /** + * Instance variable mapped to "title" tag attribute. (Mapping set in + * associated BeanInfo class.) + */ +private String titleExpr; + +/** + * Instance variable mapped to "titleKey" tag attribute. (Mapping set in + * associated BeanInfo class.) + */ +private String titleKeyExpr; + +/** * Instance variable mapped to "value" tag attribute. (Mapping set in * associated BeanInfo class.) */ @@ -184,6 +196,22 @@ } /** + * Getter method for "title" tag attribute. (Mapping set in associated + * BeanInfo class.) + */ +public String getTitleExpr() { +return (titleExpr); +} + +/** + * Getter method for "titleKey" tag attribute. (Mapping set in associated + * BeanInfo class.) + */ +public String getTitleKeyExpr() { +return (titleKeyExpr); +} + +/** * Getter method for "value" tag attribute. (Mapping set in associated * BeanInfo class.) */ @@ -272,6 +300,22 @@ } /** + * Setter method for "title" tag attribute. (Mapping set in associated + * BeanInfo class.) + */ +public void setTitleExpr(String titleExpr) { +this.titleExpr = titleExpr; +} + +/** + * Setter method for "titleKey" tag attribute. (Mapping set in associated + * BeanInfo class.) + */ +public void setStyleIdExpr(String titleKeyExpr) { +this.titleKeyExpr = titleKeyExpr; +} + +/** * Setter method for "value" tag attribute. (Mapping set in associated * BeanInfo class.) */ @@ -294,6 +338,8 @@ setStyleExpr(null); setStyleClassExpr(null); setStyleIdExpr(null); +setTitle(null); +setTitleKey(null); setValueExpr(null); } @@ -375,6 +421,18 @@ EvalHelper.evalString("styleId", getStyleIdExpr(), this, pageContext)) != null) { setStyleId(string); +} + +if ((string = +EvalHelper.evalString("title", getTitleExpr(), this, +pageContext)) != null) { +setTitle(string); +} + +if ((string = +EvalHelper.evalString("titleKey", getTitleKeyExpr(), this, +pageContext)) != null) { +setTitleKey(string); } if ((string = Modified: struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld?view=diff&rev=551790&r1=551789&r2=551790 == --- struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld (original) +++ struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld Thu Jun 28 21:17:37 2007 @@ -5240,6 +5240,31 @@ +title +false +true + + + + + +titleKey +false +true + + + + + value true true
svn commit: r551791 - /struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java
Author: pbenedict Date: Thu Jun 28 21:29:45 2007 New Revision: 551791 URL: http://svn.apache.org/viewvc?view=rev&rev=551791 Log: STR-2072: Fix accidental dupe method Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java?view=diff&rev=551791&r1=551790&r2=551791 == --- struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java (original) +++ struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java Thu Jun 28 21:29:45 2007 @@ -311,7 +311,7 @@ * Setter method for "titleKey" tag attribute. (Mapping set in associated * BeanInfo class.) */ -public void setStyleIdExpr(String titleKeyExpr) { +public void setTitleKeyExpr(String titleKeyExpr) { this.titleKeyExpr = titleKeyExpr; }
svn commit: r551795 - in /struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html: ELOptionTag.java ELOptionTagBeanInfo.java
Author: pbenedict Date: Thu Jun 28 22:22:34 2007 New Revision: 551795 URL: http://svn.apache.org/viewvc?view=rev&rev=551795 Log: STR-2072: Fix ELOptionTag.release() and missing properties for TagBeanInfo Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTagBeanInfo.java Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java?view=diff&rev=551795&r1=551794&r2=551795 == --- struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java (original) +++ struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTag.java Thu Jun 28 22:22:34 2007 @@ -338,8 +338,8 @@ setStyleExpr(null); setStyleClassExpr(null); setStyleIdExpr(null); -setTitle(null); -setTitleKey(null); +setTitleExpr(null); +setTitleKeyExpr(null); setValueExpr(null); } Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTagBeanInfo.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTagBeanInfo.java?view=diff&rev=551795&r1=551794&r2=551795 == --- struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTagBeanInfo.java (original) +++ struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELOptionTagBeanInfo.java Thu Jun 28 22:22:34 2007 @@ -102,6 +102,18 @@ } try { +proplist.add(new PropertyDescriptor("title", ELOptionTag.class, +null, "setTitleExpr")); +} catch (IntrospectionException ex) { +} + +try { +proplist.add(new PropertyDescriptor("titleKey", ELOptionTag.class, +null, "setTitleKeyExpr")); +} catch (IntrospectionException ex) { +} + +try { proplist.add(new PropertyDescriptor("value", ELOptionTag.class, null, "setValueExpr")); } catch (IntrospectionException ex) {
svn commit: r551796 - /struts/struts1/trunk/apps/examples/src/main/webapp/exercise/html-select.jsp
Author: pbenedict Date: Thu Jun 28 22:23:23 2007 New Revision: 551796 URL: http://svn.apache.org/viewvc?view=rev&rev=551796 Log: STR-2072: Add title and titleKey examples for html:option Modified: struts/struts1/trunk/apps/examples/src/main/webapp/exercise/html-select.jsp Modified: struts/struts1/trunk/apps/examples/src/main/webapp/exercise/html-select.jsp URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/examples/src/main/webapp/exercise/html-select.jsp?view=diff&rev=551796&r1=551795&r2=551796 == --- struts/struts1/trunk/apps/examples/src/main/webapp/exercise/html-select.jsp (original) +++ struts/struts1/trunk/apps/examples/src/main/webapp/exercise/html-select.jsp Thu Jun 28 22:23:23 2007 @@ -67,16 +67,16 @@ Single Select Allowed: - Single 0 - Single 1 - Single 2 - Single 3 - Single 4 - Single 5 - Single 6 - Single 7 - Single 8 - Single 9 + Single 0 + Single 1 + Single 2 + Single 3 + Single 4 + Single 5 + Single 6 + Single 7 + Single 8 + Single 9 @@ -105,12 +105,12 @@ - Select With Labels From Resources: + Select With Labels and Titles From Resources: - - - + + +
svn commit: r551797 - in /struts/struts1/trunk/apps/el-example/src/main: java/org/apache/struts/webapp/el/exercise/ApplicationResources.properties webapp/html-select.jsp
Author: pbenedict Date: Thu Jun 28 22:23:32 2007 New Revision: 551797 URL: http://svn.apache.org/viewvc?view=rev&rev=551797 Log: STR-2072: Add title and titleKey examples for html:option Modified: struts/struts1/trunk/apps/el-example/src/main/java/org/apache/struts/webapp/el/exercise/ApplicationResources.properties struts/struts1/trunk/apps/el-example/src/main/webapp/html-select.jsp Modified: struts/struts1/trunk/apps/el-example/src/main/java/org/apache/struts/webapp/el/exercise/ApplicationResources.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/el-example/src/main/java/org/apache/struts/webapp/el/exercise/ApplicationResources.properties?view=diff&rev=551797&r1=551796&r2=551797 == --- struts/struts1/trunk/apps/el-example/src/main/java/org/apache/struts/webapp/el/exercise/ApplicationResources.properties (original) +++ struts/struts1/trunk/apps/el-example/src/main/java/org/apache/struts/webapp/el/exercise/ApplicationResources.properties Thu Jun 28 22:23:32 2007 @@ -13,3 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. +select.single.9=Nine \ No newline at end of file Modified: struts/struts1/trunk/apps/el-example/src/main/webapp/html-select.jsp URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/el-example/src/main/webapp/html-select.jsp?view=diff&rev=551797&r1=551796&r2=551797 == --- struts/struts1/trunk/apps/el-example/src/main/webapp/html-select.jsp (original) +++ struts/struts1/trunk/apps/el-example/src/main/webapp/html-select.jsp Thu Jun 28 22:23:32 2007 @@ -81,19 +81,19 @@ Single Select Allowed: -Single 0 -Single 1 -Single 2 -Single 0 +Single 1 +Single 2 + Single 3 -Single 4 -Single 5 -Single 6 -Single 7 -Single 8 -Single +Single 4 +Single 5 +Single 6 +Single 7 +Single 8 +Single 9
svn commit: r551801 - /struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld
Author: pbenedict Date: Thu Jun 28 22:35:45 2007 New Revision: 551801 URL: http://svn.apache.org/viewvc?view=rev&rev=551801 Log: STR-2072: Add title and titleKey to label Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld?view=diff&rev=551801&r1=551800&r2=551801 == --- struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld (original) +++ struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Thu Jun 28 22:35:45 2007 @@ -4605,6 +4605,27 @@ ]]> + +title +false +true + + + + + +titleKey +false +true + + + + link
svn commit: r552086 - in /struts/struts1/trunk/taglib/src/main: java/org/apache/struts/taglib/html/MessagesTag.java resources/META-INF/tld/struts-html.tld
Author: pbenedict Date: Fri Jun 29 20:25:13 2007 New Revision: 552086 URL: http://svn.apache.org/viewvc?view=rev&rev=552086 Log: STR-1922: Add filterArgs parameter Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java?view=diff&rev=552086&r1=552085&r2=552086 == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java Fri Jun 29 20:25:13 2007 @@ -103,6 +103,12 @@ */ protected String message = null; +/** + * Filter the message replacement values for characters that are + * sensitive in HTML? Default is false. + */ +protected boolean filterArgs = false; + public String getId() { return (this.id); } @@ -167,6 +173,14 @@ this.message = message; } +public boolean getFilterArgs() { +return (this.filterArgs); +} + +public void setFilterArgs(boolean filterArgs) { +this.filterArgs = filterArgs; +} + /** * Construct an iterator for the specified collection, and begin looping * through the body once per element. @@ -256,8 +270,13 @@ String msg = null; if (report.isResource()) { +Object[] values = report.getValues(); +if (filterArgs) { +values = filterMessageReplacementValues(values); +} + msg = TagUtils.getInstance().message(pageContext, bundle, locale, -report.getKey(), report.getValues()); +report.getKey(), values); if (msg == null) { String bundleName = (bundle == null) ? "default" : bundle; @@ -277,6 +296,30 @@ } /** + * Performs filtering on the elements of specified Array. + * Filtering is only performed on elements which are instances of + * String. + * + * @param values The message values to be filtered + */ +private Object[] filterMessageReplacementValues(Object[] values) { + if (values == null) { + return (null); + } + + Object[] filteredArgs = new Object[values.length]; + for (int i = 0; i < values.length; ++i) { + if (values[i] instanceof String) { + filteredArgs[i] = TagUtils.getInstance().filter((String) values[i]); + } else { + filteredArgs[i] = values[i]; + } + } + + return filteredArgs; +} + +/** * Clean up after processing this enumeration. * * @throws JspException if a JSP exception has occurred @@ -310,5 +353,6 @@ header = null; footer = null; message = null; +filterArgs = false; } } Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld?view=diff&rev=552086&r1=552085&r2=552086 == --- struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld (original) +++ struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Fri Jun 29 20:25:13 2007 @@ -5353,6 +5353,26 @@ +filterArgs +false +true + + + + + locale false true
svn commit: r552090 - /struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld
Author: pbenedict Date: Fri Jun 29 20:38:12 2007 New Revision: 552090 URL: http://svn.apache.org/viewvc?view=rev&rev=552090 Log: STR-1922: Add since info to TLD Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld?view=diff&rev=552090&r1=552089&r2=552090 == --- struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld (original) +++ struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Fri Jun 29 20:38:12 2007 @@ -5369,6 +5369,9 @@ errors.divideZero=The mathematical expression <strong>{0}</strong> caused a divide by zero. + +Since: +Struts 1.4 ]]>
svn commit: r552091 - in /struts/struts1/trunk/el/src/main: java/org/apache/strutsel/taglib/html/ELMessagesTag.java java/org/apache/strutsel/taglib/html/ELMessagesTagBeanInfo.java resources/META-INF/t
Author: pbenedict Date: Fri Jun 29 20:38:38 2007 New Revision: 552091 URL: http://svn.apache.org/viewvc?view=rev&rev=552091 Log: STR-1922: Add EL version Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELMessagesTag.java struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELMessagesTagBeanInfo.java struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELMessagesTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELMessagesTag.java?view=diff&rev=552091&r1=552090&r2=552091 == --- struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELMessagesTag.java (original) +++ struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELMessagesTag.java Fri Jun 29 20:38:38 2007 @@ -52,6 +52,12 @@ private String bundleExpr; /** + * Instance variable mapped to "filterArgs" tag attribute. (Mapping set in + * associated BeanInfo class.) + */ +private String filterArgsExpr; + +/** * Instance variable mapped to "locale" tag attribute. (Mapping set in * associated BeanInfo class.) */ @@ -104,6 +110,14 @@ } /** + * Getter method for "filterArgs" tag attribute. (Mapping set in associated + * BeanInfo class.) + */ +public String getFilterArgsExpr() { +return (filterArgsExpr); +} + +/** * Getter method for "locale" tag attribute. (Mapping set in associated * BeanInfo class.) */ @@ -168,6 +182,14 @@ } /** + * Setter method for "filterArgs" tag attribute. (Mapping set in associated + * BeanInfo class.) + */ +public void setFilterArgsExpr(String filterArgsExpr) { +this.filterArgsExpr = filterArgsExpr; +} + +/** * Setter method for "locale" tag attribute. (Mapping set in associated * BeanInfo class.) */ @@ -222,6 +244,7 @@ super.release(); setIdExpr(null); setBundleExpr(null); +setFilterArgsExpr(null); setLocaleExpr(null); setNameExpr(null); setPropertyExpr(null); @@ -250,6 +273,7 @@ private void evaluateExpressions() throws JspException { String string = null; +Boolean bool = null; if ((string = EvalHelper.evalString("id", getIdExpr(), this, pageContext)) != null) { @@ -260,6 +284,12 @@ EvalHelper.evalString("bundle", getBundleExpr(), this, pageContext)) != null) { setBundle(string); +} + +if ((bool = +EvalHelper.evalBoolean("filterArgs", getFilterArgsExpr(), this, +pageContext)) != null) { +setFilterArgs(bool.booleanValue()); } if ((string = Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELMessagesTagBeanInfo.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELMessagesTagBeanInfo.java?view=diff&rev=552091&r1=552090&r2=552091 == --- struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELMessagesTagBeanInfo.java (original) +++ struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELMessagesTagBeanInfo.java Fri Jun 29 20:38:38 2007 @@ -49,6 +49,12 @@ } try { +proplist.add(new PropertyDescriptor("filterArgs", ELMessagesTag.class, +null, "setFilterArgsExpr")); +} catch (IntrospectionException ex) { +} + +try { proplist.add(new PropertyDescriptor("locale", ELMessagesTag.class, null, "setLocaleExpr")); } catch (IntrospectionException ex) { Modified: struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld?view=diff&rev=552091&r1=552090&r2=552091 == --- struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld (original) +++ struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld Fri Jun 29 20:38:38 2007 @@ -4661,6 +4661,29 @@ +filterArgs +false +true + + + + + locale false true
svn commit: r552104 - /struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java
Author: pbenedict Date: Fri Jun 29 21:42:16 2007 New Revision: 552104 URL: http://svn.apache.org/viewvc?view=rev&rev=552104 Log: STR-2893: Add javascript comment to hide CDATA Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java?view=diff&rev=552104&r1=552103&r2=552104 == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Fri Jun 29 21:42:16 2007 @@ -702,7 +702,7 @@ // xhtml content should emit CDATA section // but html content should use the browser hiding trick -results.append(isXhtml() ? "" : "// -->"); +results.append("//"); +results.append(isXhtml() ? "]]>" : "-->"); results.append(lineEnd); results.append("");
svn commit: r552241 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts/validator: FieldChecks.java LocalStrings.properties
Author: pbenedict Date: Sat Jun 30 20:39:17 2007 New Revision: 552241 URL: http://svn.apache.org/viewvc?view=rev&rev=552241 Log: STR-2611: processFailure to accept form name Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/LocalStrings.properties Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java?view=diff&rev=552241&r1=552240&r2=552241 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java Sat Jun 30 20:39:17 2007 @@ -240,7 +240,7 @@ return true; } } catch (Exception e) { -processFailure(errors, field, "mask", e); +processFailure(errors, field, validator.getFormName(), "mask", e); return false; } @@ -835,7 +835,7 @@ return false; } } catch (Exception e) { -processFailure(errors, field, "longRange", e); +processFailure(errors, field, validator.getFormName(), "longRange", e); return false; } @@ -889,7 +889,7 @@ return false; } } catch (Exception e) { -processFailure(errors, field, "intRange", e); +processFailure(errors, field, validator.getFormName(), "intRange", e); return false; } @@ -943,7 +943,7 @@ return false; } } catch (Exception e) { -processFailure(errors, field, "doubleRange", e); +processFailure(errors, field, validator.getFormName(), "doubleRange", e); return false; } @@ -997,7 +997,7 @@ return false; } } catch (Exception e) { -processFailure(errors, field, "floatRange", e); +processFailure(errors, field, validator.getFormName(), "floatRange", e); return false; } @@ -1123,7 +1123,7 @@ return false; } } catch (Exception e) { -processFailure(errors, field, "maxlength", e); +processFailure(errors, field, validator.getFormName(), "maxlength", e); return false; } @@ -1179,7 +1179,7 @@ return false; } } catch (Exception e) { -processFailure(errors, field, "minlength", e); +processFailure(errors, field, validator.getFormName(), "minlength", e); return false; } @@ -1309,11 +1309,11 @@ * Process a validation failure. */ private static void processFailure(ActionMessages errors, Field field, -String validator, Throwable t) { +String formName, String validatorName, Throwable t) { // Log the error String logErrorMsg = -sysmsgs.getMessage("validation.failed", validator, -field.getProperty(), t.toString()); +sysmsgs.getMessage("validation.failed", validatorName, +field.getProperty(), formName, t.toString()); log.error(logErrorMsg); Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/LocalStrings.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/LocalStrings.properties?view=diff&rev=552241&r1=552240&r2=552241 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/LocalStrings.properties (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/LocalStrings.properties Sat Jun 30 20:39:17 2007 @@ -14,7 +14,7 @@ # limitations under the License. system.error=SYSTEM ERROR: Check logs for details. -validation.failed={0} validation failed for property {1}: {2} +validation.failed={0} validation failed for property {1} of form key {2}: {3} variable.missing=Variable {0} is missing. variable.resource.notfound=Key {1} not found for Variable {0} in bundle {2}. invalid.range=Minimum value {0} is greater than maximum value {1}
svn commit: r552242 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhen.java
Author: pbenedict Date: Sat Jun 30 20:45:02 2007 New Revision: 552242 URL: http://svn.apache.org/viewvc?view=rev&rev=552242 Log: STR-2611: Add form name to error message Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhen.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhen.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhen.java?view=diff&rev=552242&r1=552241&r2=552242 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhen.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhen.java Sat Jun 30 20:45:02 2007 @@ -111,7 +111,7 @@ } catch (IllegalArgumentException ex) { String logErrorMsg = sysmsgs.getMessage("validation.failed", "validwhen", -field.getProperty(), ex.toString()); +field.getProperty(), validator.getFormName(), ex.toString()); log.error(logErrorMsg);
svn commit: r552351 - in /struts/struts1/trunk/apps/examples/src/main/webapp: WEB-INF/exercise/struts-config.xml exercise/html-img.jsp
Author: pbenedict Date: Sun Jul 1 12:03:52 2007 New Revision: 552351 URL: http://svn.apache.org/viewvc?view=rev&rev=552351 Log: STR-3052: Add actionId support Modified: struts/struts1/trunk/apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml struts/struts1/trunk/apps/examples/src/main/webapp/exercise/html-img.jsp Modified: struts/struts1/trunk/apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml?view=diff&rev=552351&r1=552350&r2=552351 == --- struts/struts1/trunk/apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml (original) +++ struts/struts1/trunk/apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml Sun Jul 1 12:03:52 2007 @@ -66,6 +66,7 @@ http://svn.apache.org/viewvc/struts/struts1/trunk/apps/examples/src/main/webapp/exercise/html-img.jsp?view=diff&rev=552351&r1=552350&r2=552351 == --- struts/struts1/trunk/apps/examples/src/main/webapp/exercise/html-img.jsp (original) +++ struts/struts1/trunk/apps/examples/src/main/webapp/exercise/html-img.jsp Sun Jul 1 12:03:52 2007 @@ -33,6 +33,7 @@ + Struts img tag via page attribute @@ -50,11 +51,20 @@ +Struts img tag via action attribute and actionId + + + + + + + Struts img tag via page attribute, default module +
svn commit: r552352 - /struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java
Author: pbenedict Date: Sun Jul 1 12:03:59 2007 New Revision: 552352 URL: http://svn.apache.org/viewvc?view=rev&rev=552352 Log: STR-3052: Add actionId support Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java?view=diff&rev=552352&r1=552351&r2=552352 == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java Sun Jul 1 12:03:59 2007 @@ -20,6 +20,7 @@ */ package org.apache.struts.taglib.html; +import org.apache.struts.config.ActionConfig; import org.apache.struts.config.ModuleConfig; import org.apache.struts.taglib.TagUtils; import org.apache.struts.util.MessageResources; @@ -473,6 +474,12 @@ * @throws JspException if an error occurs */ protected String src() throws JspException { +ModuleConfig moduleConfig = +ModuleUtils.getInstance().getModuleConfig(this.module, +(HttpServletRequest) pageContext.getRequest(), +pageContext.getServletContext()); + + // Deal with a direct context-relative page that has been specified if (this.page != null) { if ((this.src != null) || (this.srcKey != null) @@ -480,18 +487,13 @@ throwImgTagSrcException(); } -ModuleConfig config = -ModuleUtils.getInstance().getModuleConfig(this.module, -(HttpServletRequest) pageContext.getRequest(), -pageContext.getServletContext()); - HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String pageValue = this.page; -if (!srcDefaultReference(config)) { +if (!srcDefaultReference(moduleConfig)) { pageValue = -TagUtils.getInstance().pageURL(request, this.page, config); +TagUtils.getInstance().pageURL(request, this.page, moduleConfig); } return (request.getContextPath() + pageValue); @@ -503,20 +505,15 @@ throwImgTagSrcException(); } -ModuleConfig config = -ModuleUtils.getInstance().getModuleConfig(this.module, -(HttpServletRequest) pageContext.getRequest(), -pageContext.getServletContext()); - HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String pageValue = TagUtils.getInstance().message(pageContext, getBundle(), getLocale(), this.pageKey); -if (!srcDefaultReference(config)) { +if (!srcDefaultReference(moduleConfig)) { pageValue = -TagUtils.getInstance().pageURL(request, pageValue, config); +TagUtils.getInstance().pageURL(request, pageValue, moduleConfig); } return (request.getContextPath() + pageValue); @@ -525,6 +522,12 @@ if (this.action != null) { if ((this.src != null) || (this.srcKey != null)) { throwImgTagSrcException(); +} + +// Translate the action if it is an actionId +ActionConfig actionConfig = moduleConfig.findActionConfigId(this.action); +if (actionConfig != null) { +action = actionConfig.getPath(); } return TagUtils.getInstance().getActionMappingURL(action, module,
svn commit: r552353 - in /struts/struts1/branches/STRUTS_1_3_BRANCH: apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml apps/examples/src/main/webapp/exercise/html-img.jsp taglib/src/mai
Author: pbenedict Date: Sun Jul 1 12:04:12 2007 New Revision: 552353 URL: http://svn.apache.org/viewvc?view=rev&rev=552353 Log: STR-3052: Add actionId support Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml struts/struts1/branches/STRUTS_1_3_BRANCH/apps/examples/src/main/webapp/exercise/html-img.jsp struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml?view=diff&rev=552353&r1=552352&r2=552353 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/apps/examples/src/main/webapp/WEB-INF/exercise/struts-config.xml Sun Jul 1 12:04:12 2007 @@ -67,7 +67,9 @@ +parameter="/exercise/struts-power.gif"> + + Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/apps/examples/src/main/webapp/exercise/html-img.jsp URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/apps/examples/src/main/webapp/exercise/html-img.jsp?view=diff&rev=552353&r1=552352&r2=552353 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/apps/examples/src/main/webapp/exercise/html-img.jsp (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/apps/examples/src/main/webapp/exercise/html-img.jsp Sun Jul 1 12:04:12 2007 @@ -50,6 +50,14 @@ +Struts img tag via action attribute and actionId + + + + + + + Struts img tag via page attribute, default module Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java?view=diff&rev=552353&r1=552352&r2=552353 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java Sun Jul 1 12:04:12 2007 @@ -20,6 +20,7 @@ */ package org.apache.struts.taglib.html; +import org.apache.struts.config.ActionConfig; import org.apache.struts.config.ModuleConfig; import org.apache.struts.taglib.TagUtils; import org.apache.struts.util.MessageResources; @@ -473,6 +474,12 @@ * @throws JspException if an error occurs */ protected String src() throws JspException { +ModuleConfig moduleConfig = +ModuleUtils.getInstance().getModuleConfig(this.module, +(HttpServletRequest) pageContext.getRequest(), +pageContext.getServletContext()); + + // Deal with a direct context-relative page that has been specified if (this.page != null) { if ((this.src != null) || (this.srcKey != null) @@ -480,18 +487,13 @@ throwImgTagSrcException(); } -ModuleConfig config = -ModuleUtils.getInstance().getModuleConfig(this.module, -(HttpServletRequest) pageContext.getRequest(), -pageContext.getServletContext()); - HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String pageValue = this.page; -if (!srcDefaultReference(config)) { +if (!srcDefaultReference(moduleConfig)) { pageValue = -TagUtils.getInstance().pageURL(request, this.page, config); +TagUtils.getInstance().pageURL(request, this.page, moduleConfig); } return (request.getContextPath() + pageValue); @@ -503,20 +505,15 @@ throwImgTagSrcException(); } -ModuleConfig config = -ModuleUtils.getInstance().getModuleConfig(this.module, -(HttpServletRequest) pageContext.getRequest(), -pageContext.getServletContext()); - HttpServletRequest request = (HttpServletRequest) pageContext.getRequest(); String pageValue = TagUtils.getInstance().message(pageContext, getBundle(), getLocale(), this.pageKey); -if (!srcDefaultReference(config))
svn commit: r552390 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts/validator: FieldChecks.java LocalStrings.properties
Author: pbenedict Date: Sun Jul 1 20:19:22 2007 New Revision: 552390 URL: http://svn.apache.org/viewvc?view=rev&rev=552390 Log: STR-2611: Log form name and field when accessing property fails Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/LocalStrings.properties Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java?view=diff&rev=552390&r1=552389&r2=552390 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/FieldChecks.java Sun Jul 1 20:19:22 2007 @@ -20,6 +20,7 @@ */ package org.apache.struts.validator; +import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.validator.Field; @@ -37,7 +38,7 @@ import javax.servlet.http.HttpServletRequest; import java.io.Serializable; - +import java.util.Collection; import java.util.Locale; import java.util.StringTokenizer; @@ -66,6 +67,43 @@ public static final String FIELD_TEST_EQUAL = "EQUAL"; /** + * Convenience method for getting a value from a bean property as a + * String. If the property is a String[] or + * Collection and it is empty, an empty String + * "" is returned. Otherwise, property.toString() is returned. This method + * may return null if there was an error retrieving the + * property. + * + * NOTE: This method is a port from Commons Validator + * ValidatorUtils because the original version swallows + * exceptions and thus cannot indicate to the caller that the bean + * property was invalid. This version will throw an exception. + * + * @param bean The bean object. + * @param property The name of the property to access. + * @return The value of the property. + * @throws Exception if an error occurs retrieving the property + */ +private static String getValueAsString(Object bean, String property) +throws Exception { + +Object value = PropertyUtils.getProperty(bean, property); +if (value == null) { +return null; +} + +if (value instanceof String[]) { +return ((String[]) value).length > 0 ? value.toString() : ""; + +} else if (value instanceof Collection) { +return ((Collection) value).isEmpty() ? "" : value.toString(); + +} else { +return value.toString(); +} +} + +/** * Checks if the field isn't null and length of the field is greater than * zero not including whitespace. * @@ -86,7 +124,12 @@ HttpServletRequest request) { String value = null; -value = evaluateBean(bean, field); +try { +value = evaluateBean(bean, field); +} catch (Exception e) { +processFailure(errors, field, validator.getFormName(), "required", e); +return false; +} if (GenericValidator.isBlankOrNull(value)) { errors.add(field.getKey(), @@ -121,7 +164,12 @@ String value = null; boolean required = false; -value = evaluateBean(bean, field); +try { +value = evaluateBean(bean, field); +} catch (Exception e) { +processFailure(errors, field, validator.getFormName(), "requiredif", e); +return false; +} int i = 0; String fieldJoin = "AND"; @@ -224,9 +272,9 @@ HttpServletRequest request) { String value = null; -value = evaluateBean(bean, field); - try { +value = evaluateBean(bean, field); + String mask = Resources.getVarValue("mask", field, validator, request, true); @@ -267,7 +315,12 @@ Object result = null; String value = null; -value = evaluateBean(bean, field); +try { +value = evaluateBean(bean, field); +} catch (Exception e) { +processFailure(errors, field, validator.getFormName(), "byte", e); +return Boolean.FALSE; +} if (GenericValidator.isBlankOrNull(value)) { return Boolean.TRUE; @@ -304,7 +357,12 @@ Object result = null; String value = null; -value = evaluateBean(bean, field); +try { +value = evaluateBean(bean, field); +} catch (Exception e) { +
svn commit: r552396 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java
Author: pbenedict Date: Sun Jul 1 21:03:17 2007 New Revision: 552396 URL: http://svn.apache.org/viewvc?view=rev&rev=552396 Log: STR-1674: Check cancellation first and possibly skip population Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java?view=diff&rev=552396&r1=552395&r2=552396 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java Sun Jul 1 21:03:17 2007 @@ -45,21 +45,26 @@ */ public boolean execute(ActionContext actionCtx) throws Exception { -// Is there a form bean for this request? + +ActionConfig actionConfig = actionCtx.getActionConfig(); ActionForm actionForm = actionCtx.getActionForm(); +// First determine if the request was cancelled +handleCancel(actionCtx, actionConfig, actionForm); + +// Is there a form bean for this request? if (actionForm == null) { return (false); } -// Reset the form bean property values -ActionConfig actionConfig = actionCtx.getActionConfig(); +// If request is cancelled, form manipulation is prevented +if (actionCtx.getCancelled().booleanValue()) { +return (false); +} +// Reset and repopulate the form bean property values reset(actionCtx, actionConfig, actionForm); - populate(actionCtx, actionConfig, actionForm); - -handleCancel(actionCtx, actionConfig, actionForm); return (false); }
svn commit: r553061 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts: action/ActionResources.properties action/ActionResources_ja.properties action/RequestProcessor.java chain/commands/
Author: pbenedict Date: Tue Jul 3 21:12:11 2007 New Revision: 553061 URL: http://svn.apache.org/viewvc?view=rev&rev=553061 Log: STR-1809: Add ActionConfig to log message when action cannot instantiate Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties?view=diff&rev=553061&r1=553060&r2=553061 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties Tue Jul 3 21:12:11 2007 @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -actionCreate=No action instance for path {0} could be created +actionCreate=No action instance for path \'{0}\' could be created from action config: {1} applicationLoading=Loading application resources from resource {0} applicationResources=Cannot load application resources bundle {0} configCompleted=Verification of ModuleConfig has been completed Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties?view=diff&rev=553061&r1=553060&r2=553061 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties Tue Jul 3 21:12:11 2007 @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -actionCreate=\u30D1\u30B9 {0} \u306B\u5BFE\u3059\u308B\u30A2\u30AF\u30B7\u30E7\u30F3\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093 +actionCreate=\u30D1\u30B9 \'{0}\' \u306B\u5BFE\u3059\u308B\u30A2\u30AF\u30B7\u30E7\u30F3\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u304C\u3042\u308A\u307E\u305B\u3093: {1} applicationLoading={0} \u304b\u3089\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30ea\u30bd\u30fc\u30b9\u3092\u30ed\u30fc\u30c9\u3057\u307e\u3059 applicationResources=\u30ea\u30bd\u30fc\u30b9\u30d0\u30f3\u30c9\u30eb {0} \u3092\u30ed\u30fc\u30c9\u3067\u304d\u307e\u305b\u3093 configCompleted=ModuleConfig\u306E\u691C\u8A3C\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java?view=diff&rev=553061&r1=553060&r2=553061 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java Tue Jul 3 21:12:11 2007 @@ -284,7 +284,7 @@ // instead of returning null. } catch (Exception e) { log.error(getInternal().getMessage("actionCreate", -mapping.getPath()), e); +mapping.getPath(), mapping.toString()), e); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, getInternal().getMessage("actionCreate", mapping.getPath())); Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java?view=diff&rev=553061&r1=553060&r2=553061 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java Tue Jul 3 21:12:11 2007 @@ -50,6 +50,10 @@ protected synchronized Action getAction(Actio
svn commit: r553079 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts/action: ActionResources.properties ActionServlet.java
Author: pbenedict Date: Tue Jul 3 21:46:17 2007 New Revision: 553079 URL: http://svn.apache.org/viewvc?view=rev&rev=553079 Log: STR-1819: Warn if a form is not declared but later used Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties?view=diff&rev=553079&r1=553078&r2=553079 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties Tue Jul 3 21:46:17 2007 @@ -14,6 +14,7 @@ # limitations under the License. actionCreate=No action instance for path \'{0}\' could be created from action config: {1} +actionFormUnknown=Action config of path \'{0}\' references undeclared form bean \'{1}\' (typo or dynamic reference?) applicationLoading=Loading application resources from resource {0} applicationResources=Cannot load application resources bundle {0} configCompleted=Verification of ModuleConfig has been completed Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java?view=diff&rev=553079&r1=553078&r2=553079 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Tue Jul 3 21:46:17 2007 @@ -1346,6 +1346,18 @@ for (int i = 0; i < actionConfigs.length; i++) { ActionConfig actionConfig = actionConfigs[i]; +// Verify the form, if specified, exists to help the developer +// detect a possible typo. It is also possible the missing +// reference is a dynamic runtime bean +String formName = actionConfig.getName(); +if (formName != null) { +FormBeanConfig formConfig = config.findFormBeanConfig(formName); +if (formConfig == null) { +log.warn(getInternal().getMessage("actionFormUnknown", +actionConfig.getPath(), formName)); +} +} + processActionConfigExtension(actionConfig, config); }
svn commit: r553240 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java
Author: pbenedict Date: Wed Jul 4 08:27:07 2007 New Revision: 553240 URL: http://svn.apache.org/viewvc?view=rev&rev=553240 Log: STR-2700: Clear input stream on aborted upload Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java?view=diff&rev=553240&r1=553239&r2=553240 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java Wed Jul 4 08:27:07 2007 @@ -33,6 +33,7 @@ import javax.servlet.ServletContext; import javax.servlet.ServletException; +import javax.servlet.ServletInputStream; import javax.servlet.http.HttpServletRequest; import java.io.File; @@ -188,10 +189,11 @@ // Special handling for uploads that are too big. request.setAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED, Boolean.TRUE); - +clearInputStream(request); return; } catch (FileUploadException e) { log.error("Failed to parse multipart request", e); +clearInputStream(request); throw new ServletException(e); } @@ -266,6 +268,23 @@ } // Support Methods + +/** + * Finishes reading the input stream from an aborted upload. Fix for + * STR-2700 to prevent Window machines from hanging. + */ +protected void clearInputStream(HttpServletRequest request) { +try { +ServletInputStream is = request.getInputStream(); +byte[] data = new byte[DEFAULT_SIZE_THRESHOLD]; +int bytesRead = 0; +do { +bytesRead = is.read(data); +} while (bytesRead > -1); +} catch (Exception e) { +log.error(e.getMessage(), e); +} +} /** * Returns the maximum allowable size, in bytes, of an uploaded file.
svn commit: r553322 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java
Author: pbenedict Date: Wed Jul 4 13:13:39 2007 New Revision: 553322 URL: http://svn.apache.org/viewvc?view=rev&rev=553322 Log: STR-2700: Narrow the stream clearing to Windows only Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java?view=diff&rev=553322&r1=553321&r2=553322 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java Wed Jul 4 13:13:39 2007 @@ -275,12 +275,14 @@ */ protected void clearInputStream(HttpServletRequest request) { try { -ServletInputStream is = request.getInputStream(); -byte[] data = new byte[DEFAULT_SIZE_THRESHOLD]; -int bytesRead = 0; -do { -bytesRead = is.read(data); -} while (bytesRead > -1); +if (System.getProperty("os.name").contains("Windows")) { +ServletInputStream is = request.getInputStream(); +byte[] data = new byte[DEFAULT_SIZE_THRESHOLD]; +int bytesRead = 0; +do { +bytesRead = is.read(data); +} while (bytesRead > -1); +} } catch (Exception e) { log.error(e.getMessage(), e); }
svn commit: r554216 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java
Author: pbenedict Date: Sat Jul 7 08:00:03 2007 New Revision: 554216 URL: http://svn.apache.org/viewvc?view=rev&rev=554216 Log: STR-1674: Limit cancellation change to no form only Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java?view=diff&rev=554216&r1=554215&r2=554216 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java Sat Jul 7 08:00:03 2007 @@ -57,11 +57,6 @@ return (false); } -// If request is cancelled, form manipulation is prevented -if (actionCtx.getCancelled().booleanValue()) { -return (false); -} - // Reset and repopulate the form bean property values reset(actionCtx, actionConfig, actionForm); populate(actionCtx, actionConfig, actionForm);
svn commit: r554496 - in /struts/struts1/trunk/core/src/main: java/org/apache/struts/chain/commands/servlet/CreateAction.java java/org/apache/struts/config/ActionConfig.java resources/org/apache/strut
Author: pbenedict Date: Sun Jul 8 17:25:54 2007 New Revision: 554496 URL: http://svn.apache.org/viewvc?view=rev&rev=554496 Log: STR-3067: Add singleton/prototype instantiation policy for actions Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_4.dtd Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java?view=diff&rev=554496&r1=554495&r2=554496 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/CreateAction.java Sun Jul 8 17:25:54 2007 @@ -65,29 +65,31 @@ Action action = null; -synchronized (actions) { -action = (Action) actions.get(type); - -if (action == null) { -try { -action = createAction(context, type); -} catch (Exception e) { -log.error(actionServlet.getInternal().getMessage( -"actionCreate", actionConfig.getPath(), -actionConfig.toString()), e); -throw e; +try { +if (actionConfig.isSingleton()) { +synchronized (actions) { +action = (Action) actions.get(type); +if (action == null) { +action = createAction(context, type); +actions.put(type, action); +} } -actions.put(type, action); +} else { +action = createAction(context, type); } +} catch (Exception e) { +log.error(actionServlet.getInternal().getMessage( +"actionCreate", actionConfig.getPath(), +actionConfig.toString()), e); +throw e; } - + if (action.getServlet() == null) { action.setServlet(actionServlet); } return (action); } - /** * Invoked by getAction when the Action Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java?view=diff&rev=554496&r1=554495&r2=554496 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java Sun Jul 8 17:25:54 2007 @@ -193,6 +193,12 @@ * form bean is accessed, if any. */ protected String scope = "session"; + +/** + * Should this action be instantiated once per module (singleton) + * or once per request (prototype)? + */ +protected boolean singleton = true; /** * Identifies conditions for automatic form reset. @@ -715,6 +721,30 @@ this.populate= populate; } + +/** + * Determines whether this action is a singleton (one per module) + * or a prototype (one per request). Actions are defaulted to + * singletons unless otherwise specified. + * + * @return true for singleton; otherwise prototype + * @see #setSingleton(boolean) + * @since Struts 1.4 + */ +public boolean isSingleton() { +return this.singleton; +} + +/** + * Stores whether this action is a singleton. + * + * @param singleton true for singleton; otherwise prototype + * @see #isSingleton() + * @since Struts 1.4 + */ +public void setSingleton(boolean singleton) { +this.singleton = singleton; +} /** * Return suffix used to match request parameter names to form bean @@ -1373,6 +1403,9 @@ sb.append(",populate="); sb.append(populate); } + +sb.append(",singleton="); +sb.append(singleton); if (suffix != null) { sb.append(",suffix="); Modified: struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_4.dtd URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_4.dtd?view=diff&rev=554496&r1=554495&r2=554496 ==
svn commit: r555462 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionMapping.java
Author: pbenedict Date: Wed Jul 11 19:17:11 2007 New Revision: 555462 URL: http://svn.apache.org/viewvc?view=rev&rev=555462 Log: STR-2499: Add findRequiredForward Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionMapping.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionMapping.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionMapping.java?view=diff&rev=555462&r1=555461&r2=555462 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionMapping.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionMapping.java Wed Jul 11 19:17:11 2007 @@ -65,6 +65,7 @@ * @param forwardName Logical name of the forwarding instance to be *returned * @return The local or global forward with the specified name. + * @see #findRequiredForward(String) */ public ActionForward findForward(String forwardName) { ForwardConfig config = findForwardConfig(forwardName); @@ -73,6 +74,7 @@ config = getModuleConfig().findForwardConfig(forwardName); } +// TODO: remove warning since findRequiredForward takes care of use case? if (config == null) { if (log.isWarnEnabled()) { log.warn("Unable to find '" + forwardName + "' forward."); @@ -80,6 +82,27 @@ } return ((ActionForward) config); +} + +/** + * Find and return the ForwardConfig instance of this + * mapping, throwing an exception if not found locally or globally. + * + * @param forwardName Logical name of the forwarding instance to be + *returned + * @return The local or global forward with the specified name. + * @throws IllegalStateException if the forward is not found + * @see #findForward(String) + * @since Struts 1.4 + */ +public ActionForward findRequiredForward(String forwardName) { +ActionForward forward = findForward(forwardName); +if (forward == null) { +throw new IllegalStateException( +"Unable to find '" + forwardName + +"' forward of action path '" + getPath() + "'"); +} +return forward; } /**
svn commit: r556789 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java
Author: pbenedict Date: Mon Jul 16 18:59:13 2007 New Revision: 556789 URL: http://svn.apache.org/viewvc?view=rev&rev=556789 Log: STR-3068: Warn when using the classic RequestProcessor Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java?view=diff&rev=556789&r1=556788&r2=556789 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Mon Jul 16 18:59:13 2007 @@ -40,6 +40,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts.Globals; +import org.apache.struts.chain.ComposableRequestProcessor; import org.apache.struts.config.ActionConfig; import org.apache.struts.config.ConfigRuleSet; import org.apache.struts.config.ExceptionConfig; @@ -617,6 +618,15 @@ "Cannot initialize RequestProcessor of class " + config.getControllerConfig().getProcessorClass() + ": " + e); +} + +// Emit a warning to the log if the classic RequestProcessor is +// being used without composition. Hopefully developers will +// heed this message and make the upgrade. +if (!(processor instanceof ComposableRequestProcessor)) { +log.warn("Use of the classic RequestProcessor is not recommended. " + +"Please upgrade to the ComposableRequestProcessor to " + +"receive the advantage of modern enhancements and fixes."); } processor.init(this, config);
svn commit: r556797 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java
Author: pbenedict Date: Mon Jul 16 20:17:01 2007 New Revision: 556797 URL: http://svn.apache.org/viewvc?view=rev&rev=556797 Log: STR-3070: Set original path for postback forms Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java?view=diff&rev=556797&r1=556796&r2=556797 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/RequestProcessor.java Mon Jul 16 20:17:01 2007 @@ -741,6 +741,11 @@ throws IOException { String path; +// Set per request the original path for postback forms +if (request.getAttribute(Globals.ORIGINAL_URI_KEY) == null) { +request.setAttribute(Globals.ORIGINAL_URI_KEY, request.getServletPath()); +} + // For prefix matching, match on the path info (if any) path = (String) request.getAttribute(INCLUDE_PATH_INFO);
svn commit: r556798 - /struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/RequestProcessor.java
Author: pbenedict Date: Mon Jul 16 20:17:25 2007 New Revision: 556798 URL: http://svn.apache.org/viewvc?view=rev&rev=556798 Log: STR-3070: Set original path for postback forms Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/RequestProcessor.java Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/RequestProcessor.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/RequestProcessor.java?view=diff&rev=556798&r1=556797&r2=556798 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/RequestProcessor.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/RequestProcessor.java Mon Jul 16 20:17:25 2007 @@ -741,6 +741,11 @@ throws IOException { String path; +// Set per request the original path for postback forms +if (request.getAttribute(Globals.ORIGINAL_URI_KEY) == null) { +request.setAttribute(Globals.ORIGINAL_URI_KEY, request.getServletPath()); +} + // For prefix matching, match on the path info (if any) path = (String) request.getAttribute(INCLUDE_PATH_INFO);
svn commit: r557511 - /struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java
Author: pbenedict Date: Thu Jul 19 00:43:03 2007 New Revision: 557511 URL: http://svn.apache.org/viewvc?view=rev&rev=557511 Log: STR-1870: Add debug log message to explain initialization strategy (reinforce javadoc explanation) Modified: struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java Modified: struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java?view=diff&rev=557511&r1=557510&r2=557511 == --- struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java (original) +++ struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java Thu Jul 19 00:43:03 2007 @@ -151,6 +151,8 @@ private void initTilesUtil() throws ServletException { if (TilesUtil.isTilesUtilImplSet()) { +log.debug("Skipping re-init of Tiles Plugin. Values defined in the " + +"first initialized plugin take precedence."); return; }
svn commit: r557862 - /struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java
Author: pbenedict Date: Thu Jul 19 20:57:57 2007 New Revision: 557862 URL: http://svn.apache.org/viewvc?view=rev&rev=557862 Log: STR-1870: Fail fast when definition is duplicated Modified: struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java Modified: struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java?view=diff&rev=557862&r1=557861&r2=557862 == --- struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java (original) +++ struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java Thu Jul 19 20:57:57 2007 @@ -213,14 +213,12 @@ moduleConfig); if (definitionFactory != null) { -log.info( +throw new UnavailableException( "Factory already exists for module '" + moduleConfig.getPrefix() -+ "'. The factory found is from module '" -+ definitionFactory.getConfig().getFactoryName() -+ "'. No new creation."); - -return; ++ "' and cannot be redefined. " + +"The factory found is from module '" ++ definitionFactory.getConfig().getFactoryName() + "'."); } // Create configurable factory
svn commit: r557863 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/FormFile.java
Author: pbenedict Date: Thu Jul 19 21:22:56 2007 New Revision: 557863 URL: http://svn.apache.org/viewvc?view=rev&rev=557863 Log: STR-2098: Clarify FileNotFoundException depends on underlying implementation Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/FormFile.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/FormFile.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/FormFile.java?view=diff&rev=557863&r1=557862&r2=557863 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/FormFile.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/FormFile.java Thu Jul 19 21:22:56 2007 @@ -99,7 +99,9 @@ * [EMAIL PROTECTED] #getInputStream() getInputStream}. * * @return The file data as a byte array. - * @throws FileNotFoundException if the uploaded file is not found. + * @throws FileNotFoundException if the uploaded file is not found. Some + * implementations may not deal with files and/or throw + * this exception. * @throws IOException if an error occurred while reading the * file. */ @@ -110,7 +112,9 @@ * Returns an input stream for this file. The caller must close the * stream when it is no longer needed. * - * @throws FileNotFoundException if the uploaded file is not found. + * @throws FileNotFoundException if the uploaded file is not found. Some + * implementations may not deal with files and/or throw + * this exception. * @throws IOException if an error occurred while reading the * file. */
svn commit: r557865 - in /struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib: ./ bean/ html/ logic/
Author: pbenedict Date: Thu Jul 19 22:00:07 2007 New Revision: 557865 URL: http://svn.apache.org/viewvc?view=rev&rev=557865 Log: STR-2437: Add root cause to JspException Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/TagUtils.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/IncludeTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/ResourceTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/BaseHandlerTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/BaseTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/ImgTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/JavascriptValidatorTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/LinkTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MultiboxTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionsTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/RewriteTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/SelectTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/CompareTagBase.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/ForwardTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/RedirectTag.java Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/TagUtils.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/TagUtils.java?view=diff&rev=557865&r1=557864&r2=557865 == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/TagUtils.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/TagUtils.java Thu Jul 19 22:00:07 2007 @@ -884,11 +884,11 @@ } catch (IllegalAccessException e) { saveException(pageContext, e); throw new JspException(messages.getMessage("lookup.access", -property, name)); +property, name), e); } catch (IllegalArgumentException e) { saveException(pageContext, e); throw new JspException(messages.getMessage("lookup.argument", -property, name)); +property, name), e); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); @@ -898,7 +898,7 @@ saveException(pageContext, t); throw new JspException(messages.getMessage("lookup.target", -property, name)); +property, name), e); } catch (NoSuchMethodException e) { saveException(pageContext, e); @@ -916,7 +916,7 @@ } throw new JspException(messages.getMessage("lookup.method", -property, beanName)); +property, beanName), e); } } @@ -1152,7 +1152,7 @@ writer.print(text); } catch (IOException e) { saveException(pageContext, e); -throw new JspException(messages.getMessage("write.io", e.toString())); +throw new JspException(messages.getMessage("write.io", e.toString()), e); } } @@ -1176,7 +1176,7 @@ writer.print(text); } catch (IOException e) { saveException(pageContext, e); -throw new JspException(messages.getMessage("write.io", e.toString())); +throw new JspException(messages.getMessage("write.io", e.toString()), e); } } } Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/IncludeTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/IncludeTag.java?view=diff&rev=557865&r1=557864&r2=557865 == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/IncludeTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/IncludeTag.java Thu Jul 19 22:00:07 2007 @@ -188,7 +188,7 @@ } catch (MalformedURLException e) { TagUtils.getInstance().saveException(pageContext, e); throw new JspException(messages.getMessage("include.url", -e.toString())); +e.toString()), e); }
svn commit: r558248 - in /struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles: DefinitionsFactoryException.java FactoryNotFoundException.java TilesException.java TilesPlugin.java taglib/I
Author: pbenedict Date: Fri Jul 20 22:41:49 2007 New Revision: 558248 URL: http://svn.apache.org/viewvc?view=rev&rev=558248 Log: STR-2437: Add root cause to TilesException Modified: struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/DefinitionsFactoryException.java struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/FactoryNotFoundException.java struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesException.java struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/taglib/InsertTag.java struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/xmlDefinition/I18nFactorySet.java Modified: struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/DefinitionsFactoryException.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/DefinitionsFactoryException.java?view=diff&rev=558248&r1=558247&r2=558248 == --- struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/DefinitionsFactoryException.java (original) +++ struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/DefinitionsFactoryException.java Fri Jul 20 22:41:49 2007 @@ -34,7 +34,6 @@ public DefinitionsFactoryException() { super(); -this.exception = null; } /** @@ -44,80 +43,28 @@ public DefinitionsFactoryException(String message) { super(message); -this.exception = null; } /** * Create a new DefinitionsFactoryException wrapping an existing exception. * -* The existing exception will be embedded in the new -* one and its message will become the default message for -* the DefinitionsFactoryException. -* * @param e The exception to be wrapped. */ public DefinitionsFactoryException(Exception e) { super(); -this.exception = e; } /** * Create a new DefinitionsFactoryException from an existing exception. * -* The existing exception will be embedded in the new -* one, but the new exception will have its own message. -* * @param message The detail message. -* @param e The exception to be wrapped. +* @param e The root cause exception */ public DefinitionsFactoryException(String message, Exception e) { -super(message); -this.exception = e; +super(message, e); } - - - /** -* Return a detail message for this exception. -* -* If there is a embedded exception, and if the DefinitionsFactoryException -* has no detail message of its own, this method will return -* the detail message from the embedded exception. -* -* @return The error or warning message. -*/ - public String getMessage () - { -String message = super.getMessage (); - -if (message == null && exception != null) { - return exception.getMessage(); -} else { - return message; -} - } - - - /** -* Return the embedded exception, if any. -* @return The embedded exception, or null if there is none. -*/ - public Exception getException () - { -return exception; - } - - // - // Internal state. - // - - - /** - * Any "wrapped" exception will be exposed when this is serialized. - * @serial - */ - private Exception exception; } Modified: struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/FactoryNotFoundException.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/FactoryNotFoundException.java?view=diff&rev=558248&r1=558247&r2=558248 == --- struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/FactoryNotFoundException.java (original) +++ struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/FactoryNotFoundException.java Fri Jul 20 22:41:49 2007 @@ -42,4 +42,14 @@ { super(msg); } + +/** + * Constructor. + * + * @param msg Message. + * @param e the root cause exception + */ +public FactoryNotFoundException(String msg, Exception e) { +super(msg, e); +} } Modified: struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesException.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesException.java?view=diff&rev=558248&r1=558247&r2=558248 == --- struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesException.java (original) +++ struts/struts1/trunk/tiles
svn commit: r558251 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts: action/DynaActionForm.java action/DynaActionFormClass.java chain/commands/ExceptionCatcher.java chain/commands/gene
Author: pbenedict Date: Fri Jul 20 22:59:55 2007 New Revision: 558251 URL: http://svn.apache.org/viewvc?view=rev&rev=558251 Log: STR-2437: Add root cause to exceptions Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionForm.java struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionForm.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionForm.java?view=diff&rev=558251&r1=558250&r2=558251 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionForm.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionForm.java Fri Jul 20 22:59:55 2007 @@ -485,7 +485,7 @@ try { ((List) prop).set(index, value); } catch (ClassCastException e) { -throw new ConversionException(e.getMessage()); +throw new ConversionException(e.getMessage(), e); } } else { throw new IllegalArgumentException("Non-indexed property for '" Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java?view=diff&rev=558251&r1=558250&r2=558251 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java Fri Jul 20 22:59:55 2007 @@ -252,7 +252,7 @@ } catch (Throwable t) { throw new IllegalArgumentException( "Cannot instantiate ActionFormBean class '" + config.getType() -+ "': " + t); ++ "'", t); } if (!DynaActionForm.class.isAssignableFrom(beanClass)) { Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java?view=diff&rev=558251&r1=558250&r2=558251 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java Fri Jul 20 22:59:55 2007 @@ -164,7 +164,7 @@ } catch (Exception e) { LOG.warn("Exception from exceptionCommand '" + exceptionCommand + "'", e); -throw new IllegalStateException("Exception chain threw exception"); +throw new IllegalStateException("Exception chain threw exception", e); } return (true); Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java?view=diff&rev=558251&r1=558250&r2=558251 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java Fri Jul 20 22:59:55 2007 @@ -252,7 +252,7 @@ context = (ActionContextBase) ctx; } catch (ClassCastException e) { throw new IllegalStateException("ActionContext [" + ctx + "]" -+ " must be subclass of ActionContextBase"); ++ " must be subclass of ActionContextBase", e); } ActionForm form = Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java?view=diff&rev=558251&r1=558250&r2=558251 == --- struts/st
svn commit: r558254 - in /struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions: ActionDispatcher.java EventActionDispatcher.java
Author: pbenedict Date: Fri Jul 20 23:13:44 2007 New Revision: 558254 URL: http://svn.apache.org/viewvc?view=rev&rev=558254 Log: STR-2437: Add root cause to ServletException Modified: struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/ActionDispatcher.java struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/EventActionDispatcher.java Modified: struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/ActionDispatcher.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/ActionDispatcher.java?view=diff&rev=558254&r1=558253&r2=558254 == --- struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/ActionDispatcher.java (original) +++ struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/ActionDispatcher.java Fri Jul 20 23:13:44 2007 @@ -255,7 +255,7 @@ log.error(message); -throw new ServletException(message); +throw new ServletException(message, e); } return dispatchMethod(mapping, form, request, response, name, method); Modified: struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/EventActionDispatcher.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/EventActionDispatcher.java?view=diff&rev=558254&r1=558253&r2=558254 == --- struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/EventActionDispatcher.java (original) +++ struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/EventActionDispatcher.java Fri Jul 20 23:13:44 2007 @@ -151,7 +151,7 @@ LOG.error(message + " " + mapping.getParameter()); -throw new ServletException(message); +throw new ServletException(message, e); } return dispatchMethod(mapping, form, request, response, name, method);
svn commit: r558255 - /struts/struts1/trunk/scripting/src/main/java/org/apache/struts/scripting/ScriptAction.java
Author: pbenedict Date: Fri Jul 20 23:15:48 2007 New Revision: 558255 URL: http://svn.apache.org/viewvc?view=rev&rev=558255 Log: STR-2437: Add root cause to Exception Modified: struts/struts1/trunk/scripting/src/main/java/org/apache/struts/scripting/ScriptAction.java Modified: struts/struts1/trunk/scripting/src/main/java/org/apache/struts/scripting/ScriptAction.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/scripting/src/main/java/org/apache/struts/scripting/ScriptAction.java?view=diff&rev=558255&r1=558254&r2=558255 == --- struts/struts1/trunk/scripting/src/main/java/org/apache/struts/scripting/ScriptAction.java (original) +++ struts/struts1/trunk/scripting/src/main/java/org/apache/struts/scripting/ScriptAction.java Fri Jul 20 23:15:48 2007 @@ -202,7 +202,7 @@ scriptName = parseScriptName(mapping.getParameter(), bsfManager); } catch (Exception ex) { LOG.error("Unable to parse " + mapping.getParameter(), ex); -throw new Exception("Unable to parse " + mapping.getParameter()); +throw new Exception("Unable to parse " + mapping.getParameter(), ex); } if (scriptName == null) { LOG.error("No script specified in the parameter attribute");
svn commit: r558457 - in /struts/struts1/trunk/core/src/main: java/org/apache/struts/action/ActionServlet.java java/org/apache/struts/config/ActionConfig.java resources/org/apache/struts/resources/str
Author: pbenedict Date: Sat Jul 21 20:33:53 2007 New Revision: 558457 URL: http://svn.apache.org/viewvc?view=rev&rev=558457 Log: STR-3078: action configs to also extend by actionId Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_4.dtd Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java?view=diff&rev=558457&r1=558456&r2=558457 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Sat Jul 21 20:33:53 2007 @@ -1468,7 +1468,10 @@ // Make sure that this config is of the right class ActionConfig baseConfig = moduleConfig.findActionConfig(ancestor); - +if (baseConfig == null) { +baseConfig = moduleConfig.findActionConfigId(ancestor); +} + if (baseConfig == null) { throw new UnavailableException("Unable to find " + "action config for '" + ancestor + "' to extend."); Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java?view=diff&rev=558457&r1=558456&r2=558457 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java Sat Jul 21 20:33:53 2007 @@ -385,22 +385,24 @@ } /** - * Returns the path of the ActionConfig that this object should inherit - * properties from. + * Returns the path or actionId of the + * ActionConfig that this object should inherit properties + * from. * - * @return the path of the ActionConfig that this object should inherit - * properties from. + * @return the path or action id of the action mapping that this object + * should inherit properties from. */ public String getExtends() { return (this.inherit); } /** - * Set the path of the ActionConfig that this object should inherit - * properties from. + * Set the path or actionId of the + * ActionConfig that this object should inherit properties + * from. * - * @param inherit the path of the ActionConfig that this object should - *inherit properties from. + * @param inherit the path or action id of the action mapping that this + *object should inherit properties from. */ public void setExtends(String inherit) { if (configured) { @@ -882,21 +884,24 @@ * @return true if circular inheritance was detected. */ protected boolean checkCircularInheritance(ModuleConfig moduleConfig) { -String ancestorPath = getExtends(); +String ancestor = getExtends(); -while (ancestorPath != null) { -// check if we have the same path as an ancestor -if (getPath().equals(ancestorPath)) { +while (ancestor != null) { +// check if we have the same path or id as an ancestor +if (getPath().equals(ancestor) || ancestor.equals(getActionId())) { return true; } -// get our ancestor's ancestor -ActionConfig ancestor = moduleConfig.findActionConfig(ancestorPath); +// get our ancestor's config +ActionConfig baseConfig = moduleConfig.findActionConfig(ancestor); +if (baseConfig == null) { +baseConfig = moduleConfig.findActionConfigId(ancestor); +} -if (ancestor != null) { -ancestorPath = ancestor.getExtends(); +if (baseConfig != null) { +ancestor = baseConfig.getExtends(); } else { -ancestorPath = null; +ancestor = null; } } @@ -1249,15 +1254,18 @@ throw new IllegalStateException("Configuration is frozen"); } -String ancestorPath = getExtends(); +String ancestor = getExtends(); -if ((!extensionProcessed) && (ancestorPath != null)) { +if ((!extensionProcessed) && (ancestor != null)) { ActionConfig baseConfig = -
svn commit: r558583 - in /struts/struts1/trunk/el/src/main: java/org/apache/strutsel/taglib/html/ELPasswordTag.java java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java resources/META-INF/t
Author: pbenedict Date: Sun Jul 22 19:11:00 2007 New Revision: 558583 URL: http://svn.apache.org/viewvc?view=rev&rev=558583 Log: STR-3076: Add onselect to html password tag Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTag.java struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTag.java?view=diff&rev=558583&r1=558582&r2=558583 == --- struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTag.java (original) +++ struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTag.java Sun Jul 22 19:11:00 2007 @@ -198,6 +198,12 @@ private String onmouseupExpr; /** + * Instance variable mapped to "onselect" tag attribute. (Mapping set in + * associated BeanInfo class.) + */ +private String onselectExpr; + +/** * Instance variable mapped to "property" tag attribute. (Mapping set in * associated BeanInfo class.) */ @@ -480,6 +486,14 @@ } /** + * Getter method for "onselect" tag attribute. (Mapping set in associated + * BeanInfo class.) + */ +public String getOnselectExpr() { +return (onselectExpr); +} + +/** * Getter method for "property" tag attribute. (Mapping set in associated * BeanInfo class.) */ @@ -784,6 +798,14 @@ } /** + * Setter method for "onselect" tag attribute. (Mapping set in associated + * BeanInfo class.) + */ +public void setOnselectExpr(String onselectExpr) { +this.onselectExpr = onselectExpr; +} + +/** * Setter method for "property" tag attribute. (Mapping set in associated * BeanInfo class.) */ @@ -903,6 +925,7 @@ setOnmouseoutExpr(null); setOnmouseoverExpr(null); setOnmouseupExpr(null); +setOnselectExpr(null); setPropertyExpr(null); setReadonlyExpr(null); setRedisplayExpr(null); @@ -1096,6 +1119,12 @@ EvalHelper.evalString("onmouseup", getOnmouseupExpr(), this, pageContext)) != null) { setOnmouseup(string); +} + +if ((string = +EvalHelper.evalString("onselect", getOnselectExpr(), this, +pageContext)) != null) { +setOnselect(string); } if ((string = Modified: struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java?view=diff&rev=558583&r1=558582&r2=558583 == --- struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java (original) +++ struts/struts1/trunk/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java Sun Jul 22 19:11:00 2007 @@ -204,6 +204,12 @@ } try { +proplist.add(new PropertyDescriptor("onselect", +ELPasswordTag.class, null, "setOnselectExpr")); +} catch (IntrospectionException ex) { +} + +try { proplist.add(new PropertyDescriptor("property", ELPasswordTag.class, null, "setPropertyExpr")); } catch (IntrospectionException ex) { Modified: struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld?view=diff&rev=558583&r1=558582&r2=558583 == --- struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld (original) +++ struts/struts1/trunk/el/src/main/resources/META-INF/tld/struts-html-el.tld Sun Jul 22 19:11:00 2007 @@ -5938,6 +5938,19 @@ +onselect +false +true + + + + + property true true
svn commit: r558584 - in /struts/struts1/trunk/taglib/src/main/resources/META-INF/tld: struts-html.tld struts-nested.tld
Author: pbenedict Date: Sun Jul 22 19:11:13 2007 New Revision: 558584 URL: http://svn.apache.org/viewvc?view=rev&rev=558584 Log: STR-3076: Add onselect to html password tag Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-nested.tld Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld?view=diff&rev=558584&r1=558583&r2=558584 == --- struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld (original) +++ struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Sun Jul 22 19:11:13 2007 @@ -6708,6 +6708,19 @@ +onselect +false +true + + + + + property true true Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-nested.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-nested.tld?view=diff&rev=558584&r1=558583&r2=558584 == --- struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-nested.tld (original) +++ struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-nested.tld Sun Jul 22 19:11:13 2007 @@ -2846,6 +2846,11 @@ +onselect +false +true + + property true true
svn commit: r558598 - in /struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld: struts-html.tld struts-nested.tld
Author: pbenedict Date: Sun Jul 22 21:27:40 2007 New Revision: 558598 URL: http://svn.apache.org/viewvc?view=rev&rev=558598 Log: STR-3076: Add onselect to html password tag Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-html.tld struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-nested.tld Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-html.tld URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-html.tld?view=diff&rev=558598&r1=558597&r2=558598 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-html.tld (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-html.tld Sun Jul 22 21:27:40 2007 @@ -6307,6 +6307,19 @@ +onselect +false +true + + + + + property true true Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-nested.tld URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-nested.tld?view=diff&rev=558598&r1=558597&r2=558598 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-nested.tld (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-nested.tld Sun Jul 22 21:27:40 2007 @@ -2846,6 +2846,11 @@ +onselect +false +true + + property true true
svn commit: r558599 - in /struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main: java/org/apache/strutsel/taglib/html/ELPasswordTag.java java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java
Author: pbenedict Date: Sun Jul 22 21:36:07 2007 New Revision: 558599 URL: http://svn.apache.org/viewvc?view=rev&rev=558599 Log: STR-3076: Add onselect to html password tag Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTag.java struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/resources/META-INF/tld/struts-html-el.tld Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTag.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTag.java?view=diff&rev=558599&r1=558598&r2=558599 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTag.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTag.java Sun Jul 22 21:36:07 2007 @@ -198,6 +198,12 @@ private String onmouseupExpr; /** + * Instance variable mapped to "onselect" tag attribute. (Mapping set in + * associated BeanInfo class.) + */ +private String onselectExpr; + +/** * Instance variable mapped to "property" tag attribute. (Mapping set in * associated BeanInfo class.) */ @@ -480,6 +486,14 @@ } /** + * Getter method for "onselect" tag attribute. (Mapping set in associated + * BeanInfo class.) + */ +public String getOnselectExpr() { +return (onselectExpr); +} + +/** * Getter method for "property" tag attribute. (Mapping set in associated * BeanInfo class.) */ @@ -784,6 +798,14 @@ } /** + * Setter method for "onselect" tag attribute. (Mapping set in associated + * BeanInfo class.) + */ +public void setOnselectExpr(String onselectExpr) { +this.onselectExpr = onselectExpr; +} + +/** * Setter method for "property" tag attribute. (Mapping set in associated * BeanInfo class.) */ @@ -903,6 +925,7 @@ setOnmouseoutExpr(null); setOnmouseoverExpr(null); setOnmouseupExpr(null); +setOnselectExpr(null); setPropertyExpr(null); setReadonlyExpr(null); setRedisplayExpr(null); @@ -1096,6 +1119,12 @@ EvalHelper.evalString("onmouseup", getOnmouseupExpr(), this, pageContext)) != null) { setOnmouseup(string); +} + +if ((string = +EvalHelper.evalString("onselect", getOnselectExpr(), this, +pageContext)) != null) { +setOnselect(string); } if ((string = Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java?view=diff&rev=558599&r1=558598&r2=558599 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/java/org/apache/strutsel/taglib/html/ELPasswordTagBeanInfo.java Sun Jul 22 21:36:07 2007 @@ -204,6 +204,12 @@ } try { +proplist.add(new PropertyDescriptor("onselect", +ELPasswordTag.class, null, "setOnselectExpr")); +} catch (IntrospectionException ex) { +} + +try { proplist.add(new PropertyDescriptor("property", ELPasswordTag.class, null, "setPropertyExpr")); } catch (IntrospectionException ex) { Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/resources/META-INF/tld/struts-html-el.tld URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/resources/META-INF/tld/struts-html-el.tld?view=diff&rev=558599&r1=558598&r2=558599 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/resources/META-INF/tld/struts-html-el.tld (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/el/src/main/resources/META-INF/tld/struts-html-el.tld Sun Jul 22 21:36:07 2007 @@ -5890,6 +5890,19 @@ +onselect +false +true + + + + + property true true
svn commit: r560777 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands: AbstractPopulateActionForm.java servlet/PopulateActionForm.java
Author: pbenedict Date: Sun Jul 29 11:29:45 2007 New Revision: 560777 URL: http://svn.apache.org/viewvc?view=rev&rev=560777 Log: STR-286 and STR-1116: Push isPopulate and isReset to superclass Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java?view=diff&rev=560777&r1=560776&r2=560777 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractPopulateActionForm.java Sun Jul 29 11:29:45 2007 @@ -20,6 +20,8 @@ */ package org.apache.struts.chain.commands; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.struts.Globals; import org.apache.struts.action.ActionForm; import org.apache.struts.chain.contexts.ActionContext; @@ -34,6 +36,9 @@ * $ */ public abstract class AbstractPopulateActionForm extends ActionCommandBase { + +private static final Log log = LogFactory.getLog(AbstractPopulateActionForm.class); + // -- Public Methods /** @@ -57,14 +62,49 @@ return (false); } -// Reset and repopulate the form bean property values -reset(actionCtx, actionConfig, actionForm); -populate(actionCtx, actionConfig, actionForm); +// Reset the form bean only if configured so +if (isReset(actionCtx, actionConfig)) { +if (log.isDebugEnabled()) { +log.debug("Reseting form bean '" + actionConfig.getName() + "'"); +} +reset(actionCtx, actionConfig, actionForm); +} + +// Populate the form bean only if configured so +if (isPopulate(actionCtx, actionConfig)) { +if (log.isDebugEnabled()) { +log.debug("Populating form bean '" + actionConfig.getName() + "'"); +} +populate(actionCtx, actionConfig, actionForm); +} return (false); } // --- Protected Methods + +/** + * Determines whether an action form should be reset + * + * @param request current HTTP request + * @param actionConfig action config for current request + * @return true if action form should be reset + * + * @since Struts 1.4 + */ +protected abstract boolean isReset(ActionContext context, +ActionConfig actionConfig); + +/** + * Determines whether an action form should be populated. + * + * @param context the ActionContext we are processing + * @param actionConfig action config for current request + * @return true if action form should be populated + * @since Struts 1.4 + */ +protected abstract boolean isPopulate(ActionContext context, +ActionConfig actionConfig); /** * Call the reset() method on the specified form Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java?view=diff&rev=560777&r1=560776&r2=560777 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java Sun Jul 29 11:29:45 2007 @@ -20,8 +20,6 @@ */ package org.apache.struts.chain.commands.servlet; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.struts.Globals; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; @@ -41,7 +39,6 @@ * $ */ public class PopulateActionForm extends AbstractPopulateActionForm { -private static final Log log = LogFactory.getLog(PopulateActionForm.class); // --- Protected Methods @@ -51,23 +48,16 @@ ServletActionContext saContext = (ServletActionContext) context; HttpServletRequest request = saContext.getRequest(); -// Po
svn commit: r562341 - in /struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html: FormTag.java LocalStrings.properties
Author: pbenedict Date: Thu Aug 2 22:40:17 2007 New Revision: 562341 URL: http://svn.apache.org/viewvc?view=rev&rev=562341 Log: STR-3082: Added form name to message Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java?view=diff&rev=562341&r1=562340&r2=562341 == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Thu Aug 2 22:40:17 2007 @@ -513,7 +513,7 @@ if (bean == null) { throw new JspException(messages.getMessage("formTag.create", -beanType)); +beanType, beanName)); } pageContext.setAttribute(beanName, bean, scope); Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties?view=diff&rev=562341&r1=562340&r2=562341 == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties Thu Aug 2 22:40:17 2007 @@ -17,7 +17,7 @@ common.io=Encountered input/output error: {0} enumerateTag.enumeration=Cannot create enumeration for {0} formTag.collections=Cannot find ActionMappings or ActionFormBeans collection -formTag.create=Exception creating bean of class {0}: {1} +formTag.create=Exception creating bean of class {0} under form name {1} formTag.formBean=Cannot retrieve definition for form bean: "{0}" on action: "{1}" formTag.ignoredId=Cannot specify "styleId" when in XHTML mode as the HTML "id" \ attribute is already used to store the bean name
svn commit: r562337 - in /struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html: FormTag.java LocalStrings.properties
Author: pbenedict Date: Thu Aug 2 22:30:28 2007 New Revision: 562337 URL: http://svn.apache.org/viewvc?view=rev&rev=562337 Log: STR-3082: Added form name to message Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java?view=diff&rev=562337&r1=562336&r2=562337 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Thu Aug 2 22:30:28 2007 @@ -513,7 +513,7 @@ if (bean == null) { throw new JspException(messages.getMessage("formTag.create", -beanType)); +beanType, beanName)); } pageContext.setAttribute(beanName, bean, scope); Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties?view=diff&rev=562337&r1=562336&r2=562337 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties Thu Aug 2 22:30:28 2007 @@ -17,7 +17,7 @@ common.io=Encountered input/output error: {0} enumerateTag.enumeration=Cannot create enumeration for {0} formTag.collections=Cannot find ActionMappings or ActionFormBeans collection -formTag.create=Exception creating bean of class {0}: {1} +formTag.create=Exception creating bean of class {0} under form name {1} formTag.formBean=Cannot retrieve definition for form bean: "{0}" on action: "{1}" formTag.ignoredId=Cannot specify "styleId" when in XHTML mode as the HTML "id" \ attribute is already used to store the bean name
svn commit: r564879 - /struts/struts1/trunk/tiles/src/site/xdoc/examples.xml
Author: pbenedict Date: Sat Aug 11 02:15:39 2007 New Revision: 564879 URL: http://svn.apache.org/viewvc?view=rev&rev=564879 Log: STR-3084: Fix Tiles example error Modified: struts/struts1/trunk/tiles/src/site/xdoc/examples.xml Modified: struts/struts1/trunk/tiles/src/site/xdoc/examples.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/tiles/src/site/xdoc/examples.xml?view=diff&rev=564879&r1=564878&r2=564879 == --- struts/struts1/trunk/tiles/src/site/xdoc/examples.xml (original) +++ struts/struts1/trunk/tiles/src/site/xdoc/examples.xml Sat Aug 11 02:15:39 2007 @@ -131,7 +131,7 @@ - + ]]> Using this method of defining Tiles can be very tricky. If you define a
svn commit: r564880 - /struts/struts1/branches/STRUTS_1_3_BRANCH/tiles/src/site/xdoc/examples.xml
Author: pbenedict Date: Sat Aug 11 02:15:45 2007 New Revision: 564880 URL: http://svn.apache.org/viewvc?view=rev&rev=564880 Log: STR-3084: Fix Tiles example error Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/tiles/src/site/xdoc/examples.xml Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/tiles/src/site/xdoc/examples.xml URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/tiles/src/site/xdoc/examples.xml?view=diff&rev=564880&r1=564879&r2=564880 == --- struts/struts1/branches/STRUTS_1_3_BRANCH/tiles/src/site/xdoc/examples.xml (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/tiles/src/site/xdoc/examples.xml Sat Aug 11 02:15:45 2007 @@ -131,7 +131,7 @@ - + ]]> Using this method of defining Tiles can be very tricky. If you define a
svn commit: r564928 - in /struts/site/src/site: site.xml xdoc/announce.xml xdoc/download.xml xdoc/downloads.xml xdoc/index.xml
Author: pbenedict Date: Sat Aug 11 08:01:17 2007 New Revision: 564928 URL: http://svn.apache.org/viewvc?view=rev&rev=564928 Log: Links and announcements to 1.3.9 BETA Modified: struts/site/src/site/site.xml struts/site/src/site/xdoc/announce.xml struts/site/src/site/xdoc/download.xml struts/site/src/site/xdoc/downloads.xml struts/site/src/site/xdoc/index.xml Modified: struts/site/src/site/site.xml URL: http://svn.apache.org/viewvc/struts/site/src/site/site.xml?view=diff&rev=564928&r1=564927&r2=564928 == --- struts/site/src/site/site.xml (original) +++ struts/site/src/site/site.xml Sat Aug 11 08:01:17 2007 @@ -58,7 +58,10 @@ name="Struts 2.0.9" href="http://struts.apache.org/2.0.9/index.html"; /> http://struts.apache.org/1.3.9/index.html"; /> +http://struts.apache.org/1.3.8/index.html"; /> http://svn.apache.org/viewvc/struts/site/src/site/xdoc/announce.xml?view=diff&rev=564928&r1=564927&r2=564928 == --- struts/site/src/site/xdoc/announce.xml (original) +++ struts/site/src/site/xdoc/announce.xml Sat Aug 11 08:01:17 2007 @@ -30,6 +30,28 @@ Skip to: Announcements - 2006 +01 August 2007 - Struts v1.3.9 Beta Release + + + The Apache Struts group is pleased to announce that Struts 1.3.9 + is available as a "Beta" release. + + + + Struts 1.3.9 is available in a full distribution, or as separate + library, source, example and documentation distributions. + + + + http://struts.apache.org/download.cgi#struts139";> +http://struts.apache.org/download.cgi#struts139 + + + + It is also available in the central Maven repository under Group ID + ID "org.apache.struts". + + 24 July 2007 - Struts 2.0.9 General Availability Release with Important Security Fix http://struts.apache.org/download.cgi#struts209";>Apache Struts 2.0.9 Modified: struts/site/src/site/xdoc/download.xml URL: http://svn.apache.org/viewvc/struts/site/src/site/xdoc/download.xml?view=diff&rev=564928&r1=564927&r2=564928 == --- struts/site/src/site/xdoc/download.xml (original) +++ struts/site/src/site/xdoc/download.xml Sat Aug 11 08:01:17 2007 @@ -257,9 +257,71 @@ - - No current betas are in distribution at this time. - + + + + +http://struts.apache.org/1.x/index.html";>Struts 1.3.9 +is the current preview release of Struts 1. +It is available in a full distribution, or as +separate library, source, example and documentation +distributions. + + + + +Full Distribution: + + +struts-1.3.9-all.zip +[http://www.apache.org/dist/struts/binaries/struts-1.3.9-all.zip.asc";>PGP] +[http://www.apache.org/dist/struts/binaries/struts-1.3.9-all.zip.md5";>MD5] + + + + +Library: + + +struts-1.3.9-lib.zip +[http://www.apache.org/dist/struts/library/struts-1.3.9-lib.zip.asc";>PGP] +[http://www.apache.org/dist/struts/library/struts-1.3.9-lib.zip.md5";>MD5] + + + + +Source: + + +struts-1.3.9-src.zip +[http://www.apache.org/dist/struts/source/struts-1.3.9-src.zip.asc";>PGP] +[http://www.apache.org/dist/struts/source/struts-1.3.9-src.zip.md5";>MD5] + + + + +Examples: + + +struts-1.3.9-apps.zip +[http://www.apache.org/dist/struts/examples/struts-1.3.9-apps.zip.asc";>PGP] +[http://www.
svn commit: r564985 - /struts/site/src/site/xdoc/download.xml
Author: pbenedict Date: Sat Aug 11 16:41:18 2007 New Revision: 564985 URL: http://svn.apache.org/viewvc?view=rev&rev=564985 Log: Fix links to 1.3.x versions Modified: struts/site/src/site/xdoc/download.xml Modified: struts/site/src/site/xdoc/download.xml URL: http://svn.apache.org/viewvc/struts/site/src/site/xdoc/download.xml?view=diff&rev=564985&r1=564984&r2=564985 == --- struts/site/src/site/xdoc/download.xml (original) +++ struts/site/src/site/xdoc/download.xml Sat Aug 11 16:41:18 2007 @@ -180,7 +180,7 @@ -http://struts.apache.org/1.x/index.html";>Struts 1.3.8 +http://struts.apache.org/1.3.8/index.html";>Struts 1.3.8 is the latest production release of Struts 1. It is available in a full distribution, or as separate library, source, example and documentation @@ -261,7 +261,7 @@ -http://struts.apache.org/1.x/index.html";>Struts 1.3.9 +http://struts.apache.org/1.3.9/index.html";>Struts 1.3.9 is the current preview release of Struts 1. It is available in a full distribution, or as separate library, source, example and documentation
svn commit: r565107 - in /struts/struts1/trunk/core/src/main: java/org/apache/struts/ java/org/apache/struts/chain/commands/servlet/ java/org/apache/struts/config/ java/org/apache/struts/util/ resourc
Author: pbenedict Date: Sun Aug 12 11:35:09 2007 New Revision: 565107 URL: http://svn.apache.org/viewvc?view=rev&rev=565107 Log: STR-286 and STR-1116: Populate and reset via list of events Added: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/PopulateEvent.java (with props) Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/ActionPostProcess.java struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_4.dtd Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java?view=diff&rev=565107&r1=565106&r2=565107 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java Sun Aug 12 11:35:09 2007 @@ -49,6 +49,13 @@ public static final String CANCEL_KEY = "org.apache.struts.action.CANCEL"; /** + * The request attributes key under which chaining flag is stored. + * + * @since Struts 1.4 + */ +public static final String CHAIN_KEY = "org.apache.struts.action.CHAIN"; + +/** * The base of the context attributes key under which our * ModuleConfig data structure will be stored. This will be * suffixed with the actual module prefix (including the leading "/" @@ -209,11 +216,4 @@ * The property under which a transaction token is reported. */ public static final String TOKEN_KEY = TAGLIB_PACKAGE + ".TOKEN"; - -/** - * The request attributes key under which forwarding flag is stored. - * - * @since Struts 1.4 - */ -public static final String FORWARD_KEY = "org.apache.struts.action.FORWARD"; } Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/ActionPostProcess.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/ActionPostProcess.java?view=diff&rev=565107&r1=565106&r2=565107 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/ActionPostProcess.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/ActionPostProcess.java Sun Aug 12 11:35:09 2007 @@ -47,7 +47,7 @@ // Set flag in request object, notifying chained actions that // this request was already processed. -request.setAttribute(Globals.FORWARD_KEY, Boolean.TRUE); +request.setAttribute(Globals.CHAIN_KEY, Boolean.TRUE); // Continue chain processing return false; Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java?view=diff&rev=565107&r1=565106&r2=565107 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/PopulateActionForm.java Sun Aug 12 11:35:09 2007 @@ -27,6 +27,7 @@ import org.apache.struts.chain.contexts.ActionContext; import org.apache.struts.chain.contexts.ServletActionContext; import org.apache.struts.config.ActionConfig; +import org.apache.struts.config.PopulateEvent; import org.apache.struts.util.RequestUtils; import javax.servlet.http.HttpServletRequest; @@ -69,42 +70,37 @@ // -- Helper Methods /** - * Determines whether an action form should be populated + * Determines whether an action form should be populated. + * * @param request current HTTP request * @param actionConfig action config for current request * @return true if action form should be populated - * * @since Struts 1.4 */ protected boolean isPopulate(ActionContext context, ActionConfig actionConfig) { -ServletActionContext saContext = (ServletActionContext) context; -HttpServletRequest request = saContext.getRequest(); - -String strPopu
svn commit: r566476 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts: action/ActionServlet.java config/ModuleConfigPostProcessor.java
Author: pbenedict Date: Wed Aug 15 20:14:28 2007 New Revision: 566476 URL: http://svn.apache.org/viewvc?view=rev&rev=566476 Log: STR-3085: Module post-processing Added: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ModuleConfigPostProcessor.java (with props) Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java?view=diff&rev=566476&r1=566475&r2=566476 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Wed Aug 15 20:14:28 2007 @@ -50,6 +50,7 @@ import org.apache.struts.config.MessageResourcesConfig; import org.apache.struts.config.ModuleConfig; import org.apache.struts.config.ModuleConfigFactory; +import org.apache.struts.config.ModuleConfigPostProcessor; import org.apache.struts.config.PlugInConfig; import org.apache.struts.util.MessageResources; import org.apache.struts.util.MessageResourcesFactory; @@ -364,6 +365,7 @@ initModuleForwards(moduleConfig); initModuleExceptionConfigs(moduleConfig); initModuleActions(moduleConfig); +postProcessModule(moduleConfig); moduleConfig.freeze(); Enumeration names = getServletConfig().getInitParameterNames(); @@ -386,6 +388,7 @@ initModuleForwards(moduleConfig); initModuleExceptionConfigs(moduleConfig); initModuleActions(moduleConfig); +postProcessModule(moduleConfig); moduleConfig.freeze(); } @@ -890,6 +893,21 @@ log(errMsg, e); throw new UnavailableException(errMsg); +} +} +} + +protected void postProcessModule(ModuleConfig moduleConfig) { +String plugInKey = Globals.PLUG_INS_KEY + moduleConfig.getPrefix(); +PlugIn[] plugIns = (PlugIn[]) getServletContext().getAttribute(plugInKey); +if ((plugIns == null) || (plugIns.length == 0)) { +log.debug("No plugins to attempt post processing"); +} + +for (int i = 0; i < plugIns.length; i++) { +PlugIn plugIn = plugIns[i]; +if (plugIn instanceof ModuleConfigPostProcessor) { +((ModuleConfigPostProcessor) plugIn).postProcessModule(moduleConfig); } } } Added: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ModuleConfigPostProcessor.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ModuleConfigPostProcessor.java?view=auto&rev=566476 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ModuleConfigPostProcessor.java (added) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ModuleConfigPostProcessor.java Wed Aug 15 20:14:28 2007 @@ -0,0 +1,42 @@ +/* + * $Id$ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.struts.config; + +/** + * This interface is to be implemented by any plugin for custom modification of + * a module after it is been configured but before it is frozen. This allows for + * overriding or adding properties after standard initialization. + * + * @see ModuleConfig + * @see ModuleConfig#freeze() + * @since Struts 1.4 + * @version $Rev$ + */ +public interface ModuleConfigPostProcessor { + +/** + * Modify the specified module after its standard initialization. + * + * @param config the module + */ +void postProcessModule(ModuleConfig config); + +} Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ModuleConfigPostProcessor.java
svn commit: r567318 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts: action/ActionServlet.java config/ModuleConfigPostProcessor.java
Author: pbenedict Date: Sat Aug 18 12:34:50 2007 New Revision: 567318 URL: http://svn.apache.org/viewvc?view=rev&rev=567318 Log: STR-3085: Enhance post-processing by adding before/after events for child configs Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ModuleConfigPostProcessor.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java?view=diff&rev=567318&r1=567317&r2=567318 == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Sat Aug 18 12:34:50 2007 @@ -42,6 +42,7 @@ import org.apache.struts.Globals; import org.apache.struts.chain.ComposableRequestProcessor; import org.apache.struts.config.ActionConfig; +import org.apache.struts.config.BaseConfig; import org.apache.struts.config.ConfigRuleSet; import org.apache.struts.config.ExceptionConfig; import org.apache.struts.config.FormBeanConfig; @@ -56,7 +57,6 @@ import org.apache.struts.util.MessageResourcesFactory; import org.apache.struts.util.ModuleUtils; import org.apache.struts.util.RequestUtils; -import org.xml.sax.InputSource; import org.xml.sax.SAXException; import javax.servlet.ServletContext; @@ -68,14 +68,10 @@ import java.io.IOException; import java.io.InputStream; - import java.math.BigDecimal; import java.math.BigInteger; - import java.net.MalformedURLException; import java.net.URL; -import java.net.URLConnection; - import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator; @@ -365,7 +361,7 @@ initModuleForwards(moduleConfig); initModuleExceptionConfigs(moduleConfig); initModuleActions(moduleConfig); -postProcessModule(moduleConfig); +postProcessConfig(moduleConfig); moduleConfig.freeze(); Enumeration names = getServletConfig().getInitParameterNames(); @@ -388,7 +384,7 @@ initModuleForwards(moduleConfig); initModuleExceptionConfigs(moduleConfig); initModuleActions(moduleConfig); -postProcessModule(moduleConfig); +postProcessConfig(moduleConfig); moduleConfig.freeze(); } @@ -896,22 +892,7 @@ } } } - -protected void postProcessModule(ModuleConfig moduleConfig) { -String plugInKey = Globals.PLUG_INS_KEY + moduleConfig.getPrefix(); -PlugIn[] plugIns = (PlugIn[]) getServletContext().getAttribute(plugInKey); -if ((plugIns == null) || (plugIns.length == 0)) { -log.debug("No plugins to attempt post processing"); -} - -for (int i = 0; i < plugIns.length; i++) { -PlugIn plugIn = plugIns[i]; -if (plugIn instanceof ModuleConfigPostProcessor) { -((ModuleConfigPostProcessor) plugIn).postProcessModule(moduleConfig); -} -} -} - + /** * Initialize the form beans for the specified module. * @@ -932,7 +913,9 @@ for (int i = 0; i < formBeans.length; i++) { FormBeanConfig beanConfig = formBeans[i]; +postProcessConfig(beanConfig, config, true); processFormBeanExtension(beanConfig, config); +postProcessConfig(beanConfig, config, false); } for (int i = 0; i < formBeans.length; i++) { @@ -1078,7 +1061,9 @@ for (int i = 0; i < forwards.length; i++) { ForwardConfig forward = forwards[i]; +postProcessConfig(forward, config, true); processForwardExtension(forward, config, null); +postProcessConfig(forward, config, false); } for (int i = 0; i < forwards.length; i++) { @@ -1227,7 +1212,9 @@ for (int i = 0; i < exceptions.length; i++) { ExceptionConfig exception = exceptions[i]; +postProcessConfig(exception, config, true); processExceptionExtension(exception, config, null); +postProcessConfig(exception, config, false); } for (int i = 0; i < exceptions.length; i++) { @@ -1374,6 +1361,10 @@ for (int i = 0; i < actionConfigs.length; i++) { ActionConfig actionConfig = actionConfigs[i]; +postProcessConfig(actionConfig, config, true); +processActionConfigExtension(actionConfig, config); +postProcessConfig(actionConfig, config, false); + // Verify the form, if specified, exists to help the devel
svn commit: r568790 - in /struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean: LocalStrings.properties LocalStrings_ja.properties SizeTag.java
Author: pbenedict Date: Wed Aug 22 18:24:02 2007 New Revision: 568790 URL: http://svn.apache.org/viewvc?rev=568790&view=rev Log: STR-2779: Better explain why invalid collection (thanks to Ralf Hauser) Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings.properties struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings_ja.properties struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/SizeTag.java Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings.properties?rev=568790&r1=568789&r2=568790&view=diff == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings.properties (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings.properties Wed Aug 22 18:24:02 2007 @@ -30,7 +30,7 @@ page.selector=Invalid page context selector {0} parameter.get=No parameter {0} was included in this request resource.get=No resource {0} available in this application -size.collection=No valid collection specified for size tag +size.collection=No valid collection specified for size tag: {0} size.noCollectionOrName=Must specify either a collection or name attribute for size tag struts.missing=No Struts internal object named {0} is available struts.selector=You must specify exactly one of formBean, forward, or mapping Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings_ja.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings_ja.properties?rev=568790&r1=568789&r2=568790&view=diff == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings_ja.properties (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings_ja.properties Wed Aug 22 18:24:02 2007 @@ -30,7 +30,7 @@ page.selector=\u4e0d\u6b63\u306a\u30da\u30fc\u30b8\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u30bb\u30ec\u30af\u30bf {0} parameter.get=\u30d1\u30e9\u30e1\u30fc\u30bf {0} \u306f\u3053\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u5185\u306b\u542b\u307e\u308c\u3066\u3044\u307e\u305b\u3093 resource.get=\u30ea\u30bd\u30fc\u30b9 {0} \u306f\u3053\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093 -size.collection=size\u30bf\u30b0\u306b\u5bfe\u3057\u3066\u6709\u52b9\u306a\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093 +size.collection=size\u30bf\u30b0\u306b\u5bfe\u3057\u3066\u6709\u52b9\u306a\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093: {0} size.noCollectionOrName=size\u30bf\u30b0\u306b\u306f\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u304bname\u5c5e\u6027\u306e\u3046\u3061\u3069\u3061\u3089\u304b\u3092\u6b63\u78ba\u306b\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093 struts.missing= {0} \u3068\u3044\u3046\u540d\u79f0\u306eStruts\u306e\u5185\u90e8\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u5229\u7528\u3067\u304d\u307e\u305b\u3093 struts.selector=formBean\u3001forward\u3001mapping\u306e\u3044\u305a\u308c\u304b\u4e00\u3064\u3092\u6b63\u78ba\u306b\u6307\u5b9a\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093 Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/SizeTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/SizeTag.java?rev=568790&r1=568789&r2=568790&view=diff == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/SizeTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/SizeTag.java Wed Aug 22 18:24:02 2007 @@ -147,7 +147,8 @@ if (value == null) { JspException e = -new JspException(messages.getMessage("size.collection")); +new JspException(messages.getMessage("size.collection", +"value == null")); TagUtils.getInstance().saveException(pageContext, e); throw e; @@ -159,7 +160,8 @@ size = ((Map) value).size(); } else { JspException e = -new JspException(messages.getMessage("size.collection")); +new JspException(messages.getMessage("size.collection", +value.
svn commit: r569239 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java
Author: pbenedict Date: Thu Aug 23 21:10:12 2007 New Revision: 569239 URL: http://svn.apache.org/viewvc?rev=569239&view=rev Log: STR-3085: Swallow NPE and return null Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java?rev=569239&r1=569238&r2=569239&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Thu Aug 23 21:10:12 2007 @@ -1957,8 +1957,12 @@ * @return the array of plugins or null */ private PlugIn[] getModulePlugIns(ModuleConfig moduleConfig) { -String plugInKey = Globals.PLUG_INS_KEY + moduleConfig.getPrefix(); -return (PlugIn[]) getServletContext().getAttribute(plugInKey); +try { +String plugInKey = Globals.PLUG_INS_KEY + moduleConfig.getPrefix(); +return (PlugIn[]) getServletContext().getAttribute(plugInKey); +} catch (NullPointerException e) { +return null; +} } /**
svn commit: r569601 - /struts/site/src/site/xdoc/primer.xml
Author: pbenedict Date: Fri Aug 24 20:12:58 2007 New Revision: 569601 URL: http://svn.apache.org/viewvc?rev=569601&view=rev Log: STR-3080: Fix XSLT mispelling and update Velocity URL Modified: struts/site/src/site/xdoc/primer.xml Modified: struts/site/src/site/xdoc/primer.xml URL: http://svn.apache.org/viewvc/struts/site/src/site/xdoc/primer.xml?rev=569601&r1=569600&r2=569601&view=diff == --- struts/site/src/site/xdoc/primer.xml (original) +++ struts/site/src/site/xdoc/primer.xml Fri Aug 24 20:12:58 2007 @@ -1603,11 +1603,11 @@ JasperReports -http://jakarta.apache.org/velocity/";> +http://velocity.apache.org/";> Velocity -http://www.w3.org/TR/xslt";>XLST +http://www.w3.org/TR/xslt";>XSLT
svn commit: r569602 - /struts/struts1/branches/STRUTS_1_3_BRANCH/apps/src/site/xdoc/index.xml
Author: pbenedict Date: Fri Aug 24 20:20:01 2007 New Revision: 569602 URL: http://svn.apache.org/viewvc?rev=569602&view=rev Log: STR-3026: Remove planet struts links Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/apps/src/site/xdoc/index.xml Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/apps/src/site/xdoc/index.xml URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/apps/src/site/xdoc/index.xml?rev=569602&r1=569601&r2=569602&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/apps/src/site/xdoc/index.xml (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/apps/src/site/xdoc/index.xml Fri Aug 24 20:20:01 2007 @@ -41,26 +41,26 @@ -http://planetstruts.org/struts-blank/";> + Blank - + Struts Blank is a template you can use to create your own application. You can copy and rename the WAR, deploy it to your server, and start adding your own code. -http://planetstruts.org/struts-cookbook/";> + Cookbook - + Struts Cookbook is a show-and-tell application that demonstrates some common use cases. The source code for each example can be viewed through the application itself. -http://planetstruts.org/struts-examples/";> + Examples - + Struts Example is a modular application. Modules include an "exercise" application to test and demonstrate the Struts Taglibs, @@ -69,9 +69,9 @@ validation and localization features, -http://planetstruts.org/struts-mailreader/";> + MailReader - + Struts MailReader is a best-practices example of a typical web application.
svn commit: r569603 - /struts/struts1/trunk/apps/src/site/xdoc/index.xml
Author: pbenedict Date: Fri Aug 24 20:20:07 2007 New Revision: 569603 URL: http://svn.apache.org/viewvc?rev=569603&view=rev Log: STR-3026: Remove planet struts links Modified: struts/struts1/trunk/apps/src/site/xdoc/index.xml Modified: struts/struts1/trunk/apps/src/site/xdoc/index.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/src/site/xdoc/index.xml?rev=569603&r1=569602&r2=569603&view=diff == --- struts/struts1/trunk/apps/src/site/xdoc/index.xml (original) +++ struts/struts1/trunk/apps/src/site/xdoc/index.xml Fri Aug 24 20:20:07 2007 @@ -41,26 +41,26 @@ -http://planetstruts.org/struts-blank/";> + Blank - + Struts Blank is a template you can use to create your own application. You can copy and rename the WAR, deploy it to your server, and start adding your own code. -http://planetstruts.org/struts-cookbook/";> + Cookbook - + Struts Cookbook is a show-and-tell application that demonstrates some common use cases. The source code for each example can be viewed through the application itself. -http://planetstruts.org/struts-examples/";> + Examples - + Struts Example is a modular application. Modules include an "exercise" application to test and demonstrate the Struts Taglibs, @@ -69,9 +69,9 @@ validation and localization features, -http://planetstruts.org/struts-mailreader/";> + MailReader - + Struts MailReader is a best-practices example of a typical web application.
svn commit: r569606 - in /struts/struts1/branches/STRUTS_1_3_BRANCH/core/src: main/java/org/apache/struts/validator/validwhen/ test/java/org/apache/struts/validator/
Author: pbenedict Date: Fri Aug 24 20:54:59 2007 New Revision: 569606 URL: http://svn.apache.org/viewvc?rev=569606&view=rev Log: STR-3088: Treat blank strings as *null* Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTypes.java struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTypes.txt struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/test/java/org/apache/struts/validator/TestValidWhen.java Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java?rev=569606&r1=569605&r2=569606&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java Fri Aug 24 20:54:59 2007 @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "ValidWhenParser.g" -> "ValidWhenLexer.java"$ +// $ANTLR 2.7.6 (2005-12-22): "ValidWhenParser.g" -> "ValidWhenLexer.java"$ /* * $Id$ Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g?rev=569606&r1=569605&r2=569606&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g Fri Aug 24 20:54:59 2007 @@ -57,12 +57,12 @@ boolean intCompare = true; if ((v1 == null) || (v2 == null)) { if (String.class.isInstance(v1)) { - if (((String) v1).length() == 0) { + if (((String) v1).trim().length() == 0) { v1 = null; } } if (String.class.isInstance(v2)) { - if (((String) v2).length() == 0) { + if (((String) v2).trim().length() == 0) { v2 = null; } } @@ -182,7 +182,7 @@ Object i3 = argStack.pop(); argStack.push(ValidatorUtils.getValueAsString(form, i3 + "[" + i4 + "]" + i5)); } -| identifier LBRACKET integer RBRACKET LBRACKET { +| identifier LBRACKET integer RBRACKET { Object i7 = argStack.pop(); Object i6 = argStack.pop(); argStack.push(ValidatorUtils.getValueAsString(form, i6 + "[" + i7 + "]")); Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java?rev=569606&r1=569605&r2=569606&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java Fri Aug 24 20:54:59 2007 @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "ValidWhenParser.g" -> "ValidWhenParser.java"$ +// $ANTLR 2.7.6 (2005-12-22): "ValidWhenParser.g" -> "ValidWhenParser.java"$ /* * $Id$ @@ -69,12 +69,12 @@ boolean intCompare = true; if ((v1 == null) || (v2 == null)) { if (String.class.isInstance(v1)) { - if (((String) v1).length() == 0) { + if (((String) v1).trim().length() == 0) { v1 = null; } } if (String.class.isInstance(v
svn commit: r569607 - in /struts/struts1/trunk/core/src: main/java/org/apache/struts/validator/validwhen/ test/java/org/apache/struts/validator/
Author: pbenedict Date: Fri Aug 24 20:55:10 2007 New Revision: 569607 URL: http://svn.apache.org/viewvc?rev=569607&view=rev Log: STR-3088: Treat blank strings as *null* Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTypes.java struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTypes.txt struts/struts1/trunk/core/src/test/java/org/apache/struts/validator/TestValidWhen.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java?rev=569607&r1=569606&r2=569607&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java Fri Aug 24 20:55:10 2007 @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "ValidWhenParser.g" -> "ValidWhenLexer.java"$ +// $ANTLR 2.7.6 (2005-12-22): "ValidWhenParser.g" -> "ValidWhenLexer.java"$ /* * $Id$ Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g?rev=569607&r1=569606&r2=569607&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g Fri Aug 24 20:55:10 2007 @@ -57,12 +57,12 @@ boolean intCompare = true; if ((v1 == null) || (v2 == null)) { if (String.class.isInstance(v1)) { - if (((String) v1).length() == 0) { + if (((String) v1).trim().length() == 0) { v1 = null; } } if (String.class.isInstance(v2)) { - if (((String) v2).length() == 0) { + if (((String) v2).trim().length() == 0) { v2 = null; } } Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java?rev=569607&r1=569606&r2=569607&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java Fri Aug 24 20:55:10 2007 @@ -1,4 +1,4 @@ -// $ANTLR 2.7.2: "ValidWhenParser.g" -> "ValidWhenParser.java"$ +// $ANTLR 2.7.6 (2005-12-22): "ValidWhenParser.g" -> "ValidWhenParser.java"$ /* * $Id$ @@ -69,12 +69,12 @@ boolean intCompare = true; if ((v1 == null) || (v2 == null)) { if (String.class.isInstance(v1)) { - if (((String) v1).length() == 0) { + if (((String) v1).trim().length() == 0) { v1 = null; } } if (String.class.isInstance(v2)) { - if (((String) v2).length() == 0) { + if (((String) v2).trim().length() == 0) { v2 = null; } } Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTypes.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTypes.java?rev=569607&r1=569606&r2=569607&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTypes.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTy
svn commit: r569862 - /struts/struts1/trunk/core/pom.xml
Author: pbenedict Date: Sun Aug 26 12:18:03 2007 New Revision: 569862 URL: http://svn.apache.org/viewvc?rev=569862&view=rev Log: STR-3090: Upgrade antlr to 2.7.7 Modified: struts/struts1/trunk/core/pom.xml Modified: struts/struts1/trunk/core/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/pom.xml?rev=569862&r1=569861&r2=569862&view=diff == --- struts/struts1/trunk/core/pom.xml (original) +++ struts/struts1/trunk/core/pom.xml Sun Aug 26 12:18:03 2007 @@ -106,7 +106,7 @@ antlr antlr -2.7.2 +2.7.7 commons-beanutils
svn commit: r569926 - in /struts/struts1/trunk/core/src: main/java/org/apache/struts/validator/validwhen/ test/java/org/apache/struts/validator/
Author: pbenedict Date: Sun Aug 26 16:39:56 2007 New Revision: 569926 URL: http://svn.apache.org/viewvc?rev=569926&view=rev Log: STR-2321 and STR-2319: Compare floats and doubles Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.g struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParser.java struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTypes.java struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenParserTokenTypes.txt struts/struts1/trunk/core/src/test/java/org/apache/struts/validator/PojoBean.java struts/struts1/trunk/core/src/test/java/org/apache/struts/validator/TestValidWhen.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java?rev=569926&r1=569925&r2=569926&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/validwhen/ValidWhenLexer.java Sun Aug 26 16:39:56 2007 @@ -1,4 +1,4 @@ -// $ANTLR 2.7.6 (2005-12-22): "ValidWhenParser.g" -> "ValidWhenLexer.java"$ +// $ANTLR 2.7.7 (20060906): "ValidWhenParser.g" -> "ValidWhenLexer.java"$ /* * $Id$ @@ -23,10 +23,10 @@ package org.apache.struts.validator.validwhen; +import java.math.BigDecimal; import java.util.Stack; import org.apache.commons.validator.util.ValidatorUtils; - import java.io.InputStream; import antlr.TokenStreamException; import antlr.TokenStreamIOException; @@ -67,9 +67,9 @@ caseSensitiveLiterals = true; setCaseSensitive(false); literals = new Hashtable(); - literals.put(new ANTLRHashString("null", this), new Integer(11)); - literals.put(new ANTLRHashString("or", this), new Integer(16)); - literals.put(new ANTLRHashString("and", this), new Integer(15)); + literals.put(new ANTLRHashString("null", this), new Integer(12)); + literals.put(new ANTLRHashString("or", this), new Integer(17)); + literals.put(new ANTLRHashString("and", this), new Integer(16)); } public Token nextToken() throws TokenStreamException { @@ -88,9 +88,9 @@ theRetToken=_returnToken; break; } - case '-': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': + case '-': case '0': case '1': case '2': + case '3': case '4': case '5': case '6': + case '7': case '8': case '9': { mDECIMAL_LITERAL(true); theRetToken=_returnToken; @@ -157,11 +157,7 @@ break; } default: - if ((LA(1)=='0') && (LA(2)=='x')) { - mHEX_LITERAL(true); - theRetToken=_returnToken; - } - else if ((LA(1)=='<') && (LA(2)=='=')) { + if ((LA(1)=='<') && (LA(2)=='=')) { mLESSEQUALSIGN(true); theRetToken=_returnToken; } @@ -169,10 +165,6 @@ mGREATEREQUALSIGN(true); theRetToken=_returnToken; } - else if ((LA(1)=='0') && (true)) { - mOCTAL_LITERAL(true); - theRetToken=_returnToken; -
svn commit: r570287 - in /struts/struts1/trunk/core/src: main/java/org/apache/struts/action/ActionServlet.java main/java/org/apache/struts/action/ExceptionHandler.java test/java/org/apache/struts/acti
Author: pbenedict Date: Mon Aug 27 18:03:59 2007 New Revision: 570287 URL: http://svn.apache.org/viewvc?rev=570287&view=rev Log: STR-2924: Allow Exception key to be optional Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ExceptionHandler.java struts/struts1/trunk/core/src/test/java/org/apache/struts/action/TestActionServlet.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java?rev=570287&r1=570286&r2=570287&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Mon Aug 27 18:03:59 2007 @@ -1217,15 +1217,16 @@ postProcessConfig(exception, config, false); } -for (int i = 0; i < exceptions.length; i++) { -ExceptionConfig exception = exceptions[i]; - -// Verify that required fields are all present for the config -if (exception.getKey() == null) { -handleValueRequiredException("key", exception.getType(), -"global exception config"); -} -} +// STR-2924 +//for (int i = 0; i < exceptions.length; i++) { +//ExceptionConfig exception = exceptions[i]; +// +//// Verify that required fields are all present for the config +//if (exception.getKey() == null) { +//handleValueRequiredException("key", exception.getType(), +//"global exception config"); +//} +//} } /** @@ -1394,17 +1395,18 @@ } } -// ... and the exception configs -ExceptionConfig[] exceptions = actionConfig.findExceptionConfigs(); - -for (int j = 0; j < exceptions.length; j++) { -ExceptionConfig exception = exceptions[j]; - -if (exception.getKey() == null) { -handleValueRequiredException("key", exception.getType(), -"action exception config"); -} -} +// STR-2924 +//// ... and the exception configs +//ExceptionConfig[] exceptions = actionConfig.findExceptionConfigs(); +// +//for (int j = 0; j < exceptions.length; j++) { +//ExceptionConfig exception = exceptions[j]; +// +//if (exception.getKey() == null) { +//handleValueRequiredException("key", exception.getType(), +//"action exception config"); +//} +//} } } Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ExceptionHandler.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ExceptionHandler.java?rev=570287&r1=570286&r2=570287&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ExceptionHandler.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ExceptionHandler.java Mon Aug 27 18:03:59 2007 @@ -144,8 +144,14 @@ error = ((ModuleException) ex).getActionMessage(); property = ((ModuleException) ex).getProperty(); } else { -error = new ActionMessage(ae.getKey(), ex.getMessage()); -property = error.getKey(); +// STR-2924 +if (ae.getKey() != null) { +error = new ActionMessage(ae.getKey(), ex.getMessage()); +property = error.getKey(); +} else { +error = null; +property = null; +} } this.logException(ex); @@ -274,8 +280,9 @@ * generated from an Exception during Action * delegation. The default implementation is to set an attribute of the * request or session, as defined by the scope provided (the scope from - * the exception mapping). An ActionMessages instance is - * created, the error is added to the collection and the collection is set + * the exception mapping), if error is not null. + * Otherwise, an ActionMessages instance is created, the error + * is added to the collection and the collection is set * under the Globals.ERROR_KEY. * * @param request The request we are handling @@ -288,14 +295,16 @@ */ protected void storeException(HttpServletRequest reque
svn commit: r570628 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java
Author: pbenedict Date: Tue Aug 28 20:27:28 2007 New Revision: 570628 URL: http://svn.apache.org/viewvc?rev=570628&view=rev Log: STR-2020: Explain that NPE is caused by missing ActionServlet Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java?rev=570628&r1=570627&r2=570628&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java Tue Aug 28 20:27:28 2007 @@ -103,11 +103,20 @@ */ public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { -ServletContext application = getServlet().getServletContext(); + ActionErrors errors = new ActionErrors(); - String validationKey = getValidationKey(mapping, request); +ServletContext application; +try { +application = getServlet().getServletContext(); +} catch (NullPointerException e) { +throw new IllegalStateException( +"Missing ActionServlet instance for bean '" + +mapping.getName() + +"' (created outside of Struts?)", e); +} + Validator validator = Resources.initValidator(validationKey, this, application, request, errors, getPage());
svn commit: r591730 - in /struts/struts1/trunk/core/src/main: java/org/apache/struts/config/ConfigRuleSet.java resources/org/apache/struts/resources/struts-config_1_4.dtd
Author: pbenedict Date: Sat Nov 3 19:58:55 2007 New Revision: 591730 URL: http://svn.apache.org/viewvc?rev=591730&view=rev Log: STR-3111: Allow as a top-level element Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ConfigRuleSet.java struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_4.dtd Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ConfigRuleSet.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ConfigRuleSet.java?rev=591730&r1=591729&r2=591730&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ConfigRuleSet.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ConfigRuleSet.java Sat Nov 3 19:58:55 2007 @@ -53,6 +53,9 @@ public void addRuleInstances(Digester digester) { ClassLoader cl = digester.getClassLoader(); +digester.addRule("struts-config/set-property", +new BaseConfigSetPropertyRule()); + digester.addRule("struts-config/action-mappings", new SetActionMappingClassRule()); Modified: struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_4.dtd URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_4.dtd?rev=591730&r1=591729&r2=591730&view=diff == --- struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_4.dtd (original) +++ struts/struts1/trunk/core/src/main/resources/org/apache/struts/resources/struts-config_1_4.dtd Sat Nov 3 19:58:55 2007 @@ -101,7 +101,7 @@ hierarchy, and contains nested elements for all of the other configuration settings. --> - +
svn commit: r592622 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts: Constants.java config/impl/ModuleConfigImpl.java
Author: pbenedict Date: Tue Nov 6 22:04:21 2007 New Revision: 592622 URL: http://svn.apache.org/viewvc?rev=592622&view=rev Log: STR-3107: Add case-insensitive action matching option Added: struts/struts1/trunk/core/src/main/java/org/apache/struts/Constants.java (with props) Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/impl/ModuleConfigImpl.java Added: struts/struts1/trunk/core/src/main/java/org/apache/struts/Constants.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/Constants.java?rev=592622&view=auto == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/Constants.java (added) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/Constants.java Tue Nov 6 22:04:21 2007 @@ -0,0 +1,35 @@ +/* + * $Id$ + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.struts; + +/** + * This class provides a central location for framework configuration keys + * used to retrieve and store Struts configuration settings. + * + * @version $Rev$ + * @since Struts 1.4 + */ +public class Constants { + +/** Determines whether action mappings have case-sensitive names */ +public static final String STRUTS_URL_CASESENSITIVE = "struts.url.caseSensitive"; + +} Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/Constants.java -- svn:eol-style = native Propchange: struts/struts1/trunk/core/src/main/java/org/apache/struts/Constants.java -- svn:keywords = Date Author Id Revision HeadURL Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/impl/ModuleConfigImpl.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/config/impl/ModuleConfigImpl.java?rev=592622&r1=592621&r2=592622&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/config/impl/ModuleConfigImpl.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/config/impl/ModuleConfigImpl.java Tue Nov 6 22:04:21 2007 @@ -22,6 +22,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.apache.struts.Constants; import org.apache.struts.config.ActionConfig; import org.apache.struts.config.ActionConfigMatcher; import org.apache.struts.config.BaseConfig; @@ -37,7 +38,9 @@ import java.util.ArrayList; import java.util.HashMap; +import java.util.Map; import java.util.List; +import java.util.TreeMap; /** * The collection of static configuration information that describes a @@ -66,7 +69,7 @@ * The set of action configurations for this module, if any, keyed by * the path property. */ -protected HashMap actionConfigs = null; +protected Map actionConfigs = null; /** * The set of action configuration for this module, if any, keyed by @@ -712,4 +715,20 @@ throwIfConfigured(); messageResources.remove(config.getKey()); } + +public void setProperty(String key, String value) { +super.setProperty(key, value); + +if (Constants.STRUTS_URL_CASESENSITIVE.equals(key)) { +Map actionConfigs2; +if (!Boolean.parseBoolean(value)) { +actionConfigs2 = new TreeMap(String.CASE_INSENSITIVE_ORDER); +} else { +actionConfigs2 = new HashMap(); +} +actionConfigs2.putAll(actionConfigs); +actionConfigs = actionConfigs2; +} +} + }
svn commit: r592630 - /struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/ActionServlet.java
Author: pbenedict Date: Tue Nov 6 22:47:58 2007 New Revision: 592630 URL: http://svn.apache.org/viewvc?rev=592630&view=rev Log: STR-3110: Release log factory last Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/ActionServlet.java Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/ActionServlet.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/ActionServlet.java?rev=592630&r1=592629&r2=592630&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/ActionServlet.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/core/src/main/java/org/apache/struts/action/ActionServlet.java Tue Nov 6 22:47:58 2007 @@ -300,6 +300,9 @@ destroyInternal(); getServletContext().removeAttribute(Globals.ACTION_SERVLET_KEY); +CatalogFactory.clear(); +PropertyUtils.clearDescriptors(); + // Release our LogFactory and Log instances (if any) ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); @@ -324,9 +327,6 @@ Bugzilla #14042. It was committed for version 1.136 by craigmcc */ } - -CatalogFactory.clear(); -PropertyUtils.clearDescriptors(); } /**
svn commit: r592631 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java
Author: pbenedict Date: Tue Nov 6 22:48:04 2007 New Revision: 592631 URL: http://svn.apache.org/viewvc?rev=592631&view=rev Log: STR-3110: Release log factory last Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java?rev=592631&r1=592630&r2=592631&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Tue Nov 6 22:48:04 2007 @@ -300,6 +300,9 @@ destroyInternal(); getServletContext().removeAttribute(Globals.ACTION_SERVLET_KEY); +CatalogFactory.clear(); +PropertyUtils.clearDescriptors(); + // Release our LogFactory and Log instances (if any) ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); @@ -324,9 +327,6 @@ Bugzilla #14042. It was committed for version 1.136 by craigmcc */ } - -CatalogFactory.clear(); -PropertyUtils.clearDescriptors(); } /**
svn commit: r593842 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts: action/ActionResources.properties chain/commands/AbstractSelectInput.java chain/commands/servlet/SelectInput.java
Author: pbenedict Date: Sat Nov 10 18:57:41 2007 New Revision: 593842 URL: http://svn.apache.org/viewvc?rev=593842&view=rev Log: STR-3094: Log error when input forward does not exist Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractSelectInput.java struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/servlet/SelectInput.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties?rev=593842&r1=593841&r2=593842&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties Sat Nov 10 18:57:41 2007 @@ -33,6 +33,7 @@ formBean=Error creating form bean of class {0} forwardPathNull=The path of an ForwardConfig cannot be null initProcessor=Exception initializing RequestProcessor +inputUnknown=Action \'{0}\' declares input forward \'{1}\' but no such forward exists mappingType=Must specify one of "forward", "include" or "type" for path {0} notAuthorized=User is not authorized to access action {0} noInput=No input attribute for mapping path {0} Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractSelectInput.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractSelectInput.java?rev=593842&r1=593841&r2=593842&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractSelectInput.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/AbstractSelectInput.java Sat Nov 10 18:57:41 2007 @@ -67,51 +67,28 @@ ModuleConfig moduleConfig = actionConfig.getModuleConfig(); // Cache an ForwardConfig back to our input page -ForwardConfig forwardConfig; +ForwardConfig forwardConfig = null; String input = actionConfig.getInput(); if (moduleConfig.getControllerConfig().getInputForward()) { if (LOG.isTraceEnabled()) { LOG.trace("Finding ForwardConfig for '" + input + "'"); } - -// If the input parameter is specified, use that, otherwise try -// to find one in the mapping or the module under the standard -// conventional "input" name. -if (input != null) { -forwardConfig = actionConfig.findForwardConfig(input); -if (forwardConfig == null) { -forwardConfig = moduleConfig.findForwardConfig(input); -} -} else { -forwardConfig = actionConfig.findForwardConfig(Action.INPUT); -if (forwardConfig == null) { -forwardConfig = moduleConfig.findForwardConfig(Action.INPUT); -} +forwardConfig = inputForward(actionConfig, moduleConfig, input); +if (forwardConfig == null) { +LOG.error(getErrorMessage(actionCtx, actionConfig)); } } else { if (LOG.isTraceEnabled()) { LOG.trace("Delegating to forward() for '" + input + "'"); } - -// If no input parameter is specified, try to find one in the -// module under the standard conventional "input" name. Because -// the Controller is not setup to treat the input parameter as -// a mapping, the action mapping check is skipped. -if (input == null) { -forwardConfig = moduleConfig.findForwardConfig(Action.INPUT); -if (forwardConfig != null) { -input = Action.INPUT; -} -} - forwardConfig = forward(actionCtx, moduleConfig, input); } - + if (LOG.isDebugEnabled()) { LOG.debug("Forwarding back to " + forwardConfig); } - + actionCtx.setForwardConfig(forwardConfig); return (false); @@ -130,4 +107,48 @@ */ protected abstract ForwardConfig forward(ActionContext context, ModuleConfig moduleConfig, String uri); + +/** + * Retrieve error message from context. + * + * @param context The Context for the current request + * @param actionConfig Th
svn commit: r594449 - in /struts/struts1/branches/STRUTS_1_3_BRANCH: pom.xml taglib/src/main/resources/META-INF/tld/struts-html.tld
Author: pbenedict Date: Tue Nov 13 00:11:41 2007 New Revision: 594449 URL: http://svn.apache.org/viewvc?rev=594449&view=rev Log: STR-2630: Upgrade maven-taglib-plugin Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/pom.xml struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-html.tld Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/pom.xml?rev=594449&r1=594448&r2=594449&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/pom.xml (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/pom.xml Tue Nov 13 00:11:41 2007 @@ -175,14 +175,17 @@ - net.sf.dtddoc - dtddoc-maven-plugin +net.sf.dtddoc +dtddoc-maven-plugin 1.0.0 - + net.sourceforge.maven-taglib maven-taglib-plugin -2.3 +2.3.1 + + true + Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-html.tld URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-html.tld?rev=594449&r1=594448&r2=594449&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-html.tld (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/resources/META-INF/tld/struts-html.tld Tue Nov 13 00:11:41 2007 @@ -4320,7 +4320,7 @@ name (and optional property) attributes to select a java.util.Map bean that contains one or more parameter ids and corresponding values, -or nest one or more lt&;html:param> tags in the tag body. +or nest one or more <html:param> tags in the tag body. To specify a single parameter, use the paramId @@ -4365,7 +4365,7 @@ same query parameter name will be created. Supplmenting these two methods, you can nest one or more -lt&;html:param> tags to dynamically add parameters in a +<html:param> tags to dynamically add parameters in a logic-friendly way (such as executing a for loop that assigns the name/value pairs at runtime). This method does not compete with the aforementioned; it will adds its @@ -4911,20 +4911,20 @@ param org.apache.struts.taglib.html.ParamTag - + - +Since: +Struts 1.3.6 +]]> + name true
svn commit: r594450 - in /struts/struts1/trunk: pom.xml taglib/src/main/resources/META-INF/tld/struts-html.tld
Author: pbenedict Date: Tue Nov 13 00:11:57 2007 New Revision: 594450 URL: http://svn.apache.org/viewvc?rev=594450&view=rev Log: STR-2630: Upgrade maven-taglib-plugin Modified: struts/struts1/trunk/pom.xml struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Modified: struts/struts1/trunk/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/pom.xml?rev=594450&r1=594449&r2=594450&view=diff == --- struts/struts1/trunk/pom.xml (original) +++ struts/struts1/trunk/pom.xml Tue Nov 13 00:11:57 2007 @@ -176,14 +176,17 @@ - net.sf.dtddoc - dtddoc-maven-plugin +net.sf.dtddoc +dtddoc-maven-plugin 1.0.0 - + net.sourceforge.maven-taglib maven-taglib-plugin -2.3 +2.3.1 + + true + Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld?rev=594450&r1=594449&r2=594450&view=diff == --- struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld (original) +++ struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Tue Nov 13 00:11:57 2007 @@ -4673,7 +4673,7 @@ name (and optional property) attributes to select a java.util.Map bean that contains one or more parameter ids and corresponding values, -or nest one or more lt&;html:param> tags in the tag body. +or nest one or more <html:param> tags in the tag body. To specify a single parameter, use the paramId @@ -4718,7 +4718,7 @@ same query parameter name will be created. Supplmenting these two methods, you can nest one or more -lt&;html:param> tags to dynamically add parameters in a +<html:param> tags to dynamically add parameters in a logic-friendly way (such as executing a for loop that assigns the name/value pairs at runtime). This method does not compete with the aforementioned; it will adds its @@ -5264,20 +5264,20 @@ param org.apache.struts.taglib.html.ParamTag - + - +Since: +Struts 1.3.6 +]]> + name true
svn commit: r601213 - /struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java
Author: pbenedict Date: Tue Dec 4 21:46:14 2007 New Revision: 601213 URL: http://svn.apache.org/viewvc?rev=601213&view=rev Log: STR-3112: Correct javascript to focus on indexed field Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java?rev=601213&r1=601212&r2=601213&view=diff == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Tue Dec 4 21:46:14 2007 @@ -705,14 +705,22 @@ results.append(isXhtml() ? "//
svn commit: r601214 - /struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java
Author: pbenedict Date: Tue Dec 4 21:46:24 2007 New Revision: 601214 URL: http://svn.apache.org/viewvc?rev=601214&view=rev Log: STR-3112: Correct javascript to focus on indexed field Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java?rev=601214&r1=601213&r2=601214&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/taglib/src/main/java/org/apache/struts/taglib/html/FormTag.java Tue Dec 4 21:46:24 2007 @@ -706,14 +706,22 @@ results.append(lineEnd); } +// Construct the index if needed and insert into focus statement +String index = ""; +if (this.focusIndex != null) { +StringBuffer sb = new StringBuffer("["); +sb.append(this.focusIndex); +sb.append("]"); +index = sb.toString(); +} + // Construct the control name that will receive focus. -// This does not include any index. StringBuffer focusControl = new StringBuffer("document.forms[\""); - focusControl.append(beanName); focusControl.append("\"].elements[\""); focusControl.append(this.focus); focusControl.append("\"]"); +focusControl.append(index); results.append(" var focusControl = "); results.append(focusControl.toString()); @@ -727,19 +735,7 @@ results.append("focusControl.style.display != \"none\") {"); results.append(lineEnd); -// Construct the index if needed and insert into focus statement -String index = ""; - -if (this.focusIndex != null) { -StringBuffer sb = new StringBuffer("["); - -sb.append(this.focusIndex); -sb.append("]"); -index = sb.toString(); -} - results.append(" focusControl"); -results.append(index); results.append(".focus();"); results.append(lineEnd);
svn commit: r601630 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts: chain/commands/ExceptionCatcher.java config/impl/ModuleConfigImpl.java upload/CommonsMultipartRequestHandler.java v
Author: pbenedict Date: Wed Dec 5 22:49:25 2007 New Revision: 601630 URL: http://svn.apache.org/viewvc?rev=601630&view=rev Log: STR-3118: Correct method usage to meet JDK 1.4 compliance Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java struts/struts1/trunk/core/src/main/java/org/apache/struts/config/impl/ModuleConfigImpl.java struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java?rev=601630&r1=601629&r2=601630&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java Wed Dec 5 22:49:25 2007 @@ -164,7 +164,7 @@ } catch (Exception e) { LOG.warn("Exception from exceptionCommand '" + exceptionCommand + "'", e); -throw new IllegalStateException("Exception chain threw exception", e); +throw new IllegalStateException("Exception chain threw exception"); } return (true); Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/config/impl/ModuleConfigImpl.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/config/impl/ModuleConfigImpl.java?rev=601630&r1=601629&r2=601630&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/config/impl/ModuleConfigImpl.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/config/impl/ModuleConfigImpl.java Wed Dec 5 22:49:25 2007 @@ -721,7 +721,7 @@ if (Constants.STRUTS_URL_CASESENSITIVE.equals(key)) { Map actionConfigs2; -if (!Boolean.parseBoolean(value)) { +if (!Boolean.valueOf(value).booleanValue()) { actionConfigs2 = new TreeMap(String.CASE_INSENSITIVE_ORDER); } else { actionConfigs2 = new HashMap(); Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java?rev=601630&r1=601629&r2=601630&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/upload/CommonsMultipartRequestHandler.java Wed Dec 5 22:49:25 2007 @@ -275,7 +275,7 @@ */ protected void clearInputStream(HttpServletRequest request) { try { -if (System.getProperty("os.name").contains("Windows")) { +if (System.getProperty("os.name").indexOf("Windows") >= -1) { ServletInputStream is = request.getInputStream(); byte[] data = new byte[DEFAULT_SIZE_THRESHOLD]; int bytesRead = 0; Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java?rev=601630&r1=601629&r2=601630&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java Wed Dec 5 22:49:25 2007 @@ -114,7 +114,7 @@ throw new IllegalStateException( "Missing ActionServlet instance for bean '" + mapping.getName() + -"' (created outside of Struts?)", e); +"' (created outside of Struts?)"); } Validator validator =
svn commit: r601987 - in /struts/struts1/trunk/core/src/main/java/org/apache/struts: action/DynaActionFormClass.java chain/commands/ExceptionCatcher.java chain/commands/generic/CopyFormToContext.java
Author: pbenedict Date: Thu Dec 6 20:42:27 2007 New Revision: 601987 URL: http://svn.apache.org/viewvc?rev=601987&view=rev Log: STR-3118: Per Niall's comment, use the JDK 1.4 verbose way of setting the initial cause Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java?rev=601987&r1=601986&r2=601987&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java Thu Dec 6 20:42:27 2007 @@ -250,9 +250,11 @@ try { beanClass = RequestUtils.applicationClass(config.getType()); } catch (Throwable t) { -throw new IllegalArgumentException( +IllegalArgumentException e = new IllegalArgumentException( "Cannot instantiate ActionFormBean class '" + config.getType() -+ "'", t); ++ "'"); + e.initCause(t); + throw e; } if (!DynaActionForm.class.isAssignableFrom(beanClass)) { Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java?rev=601987&r1=601986&r2=601987&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/ExceptionCatcher.java Thu Dec 6 20:42:27 2007 @@ -164,7 +164,9 @@ } catch (Exception e) { LOG.warn("Exception from exceptionCommand '" + exceptionCommand + "'", e); -throw new IllegalStateException("Exception chain threw exception"); +IllegalStateException e2 = new IllegalStateException("Exception chain threw exception"); +e2.initCause(e); +throw e2; } return (true); Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java?rev=601987&r1=601986&r2=601987&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/chain/commands/generic/CopyFormToContext.java Thu Dec 6 20:42:27 2007 @@ -251,8 +251,10 @@ try { context = (ActionContextBase) ctx; } catch (ClassCastException e) { -throw new IllegalStateException("ActionContext [" + ctx + "]" -+ " must be subclass of ActionContextBase", e); +IllegalStateException e2 = new IllegalStateException("ActionContext [" + ctx + "]" ++ " must be subclass of ActionContextBase"); + e2.initCause(e); + throw e2; } ActionForm form = Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java?rev=601987&r1=601986&r2=601987&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorForm.java Thu Dec 6 20:42:27 2007 @@ -111,10 +111,12 @@ try { application = getServlet().getServletContext(); } catch (NullPointerException e) { -throw new IllegalStateException( +IllegalStateException e2 = new IllegalStateException( "Missing ActionServlet in
svn commit: r602628 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java
Author: pbenedict Date: Sat Dec 8 20:10:08 2007 New Revision: 602628 URL: http://svn.apache.org/viewvc?rev=602628&view=rev Log: STR-2587: Add populate method for ActionRedirect Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java?rev=602628&r1=602627&r2=602628&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/util/RequestUtils.java Sat Dec 8 20:10:08 2007 @@ -25,6 +25,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.struts.Globals; +import org.apache.struts.action.ActionRedirect; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; @@ -481,6 +482,26 @@ // in fact an ActionForm. ((ActionForm) bean).setMultipartRequestHandler(multipartHandler); } +} +} + +/** + * Populates the parameters of the specified ActionRedirect from + * the specified HTTP request. + * + * @param redirect The ActionRedirect whose parameters are to be set + * @param request The HTTP request whose parameters are to be used + * @since Struts 1.4 + */ +public static void populate(ActionRedirect redirect, HttpServletRequest request) { +assert (redirect != null) : "redirect is required"; +assert (request != null) : "request is required"; + +Enumeration e = request.getParameterNames(); +while (e.hasMoreElements()) { +String name = (String) e.nextElement(); +String[] values = request.getParameterValues(name); +redirect.addParameter(name, values); } }
svn commit: r602723 - /struts/struts1/trunk/core/pom.xml
Author: pbenedict Date: Sun Dec 9 11:12:14 2007 New Revision: 602723 URL: http://svn.apache.org/viewvc?rev=602723&view=rev Log: STR-3121: Bump Commons Logging to 1.1.1 Modified: struts/struts1/trunk/core/pom.xml Modified: struts/struts1/trunk/core/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/pom.xml?rev=602723&r1=602722&r2=602723&view=diff == --- struts/struts1/trunk/core/pom.xml (original) +++ struts/struts1/trunk/core/pom.xml Sun Dec 9 11:12:14 2007 @@ -142,7 +142,7 @@ commons-logging commons-logging -1.0.4 +1.1.1 commons-validator
svn commit: r602724 - /struts/struts1/trunk/mailreader-dao/pom.xml
Author: pbenedict Date: Sun Dec 9 11:12:17 2007 New Revision: 602724 URL: http://svn.apache.org/viewvc?rev=602724&view=rev Log: STR-3121: Bump Commons Logging to 1.1.1 Modified: struts/struts1/trunk/mailreader-dao/pom.xml Modified: struts/struts1/trunk/mailreader-dao/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/mailreader-dao/pom.xml?rev=602724&r1=602723&r2=602724&view=diff == --- struts/struts1/trunk/mailreader-dao/pom.xml (original) +++ struts/struts1/trunk/mailreader-dao/pom.xml Sun Dec 9 11:12:17 2007 @@ -58,7 +58,7 @@ commons-logging commons-logging -1.0.4 +1.1.1
svn commit: r663449 - in /struts/struts1/trunk: ./ apps/blank/ apps/cookbook/ apps/el-example/ apps/examples/ apps/faces-example1/ apps/faces-example2/ apps/mailreader/ apps/scripting-mailreader/ core
Author: pbenedict Date: Wed Jun 4 21:54:49 2008 New Revision: 663449 URL: http://svn.apache.org/viewvc?rev=663449&view=rev Log: STR-3152: Pull common dependencies into the parent Struts 1 POM Modified: struts/struts1/trunk/apps/blank/pom.xml struts/struts1/trunk/apps/cookbook/pom.xml struts/struts1/trunk/apps/el-example/pom.xml struts/struts1/trunk/apps/examples/pom.xml struts/struts1/trunk/apps/faces-example1/pom.xml struts/struts1/trunk/apps/faces-example2/pom.xml struts/struts1/trunk/apps/mailreader/pom.xml struts/struts1/trunk/apps/scripting-mailreader/pom.xml struts/struts1/trunk/core/pom.xml struts/struts1/trunk/el/pom.xml struts/struts1/trunk/extras/pom.xml struts/struts1/trunk/faces/pom.xml struts/struts1/trunk/mailreader-dao/pom.xml struts/struts1/trunk/pom.xml struts/struts1/trunk/scripting/pom.xml struts/struts1/trunk/taglib/pom.xml struts/struts1/trunk/tiles/pom.xml struts/struts1/trunk/tiles2/pom.xml Modified: struts/struts1/trunk/apps/blank/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/blank/pom.xml?rev=663449&r1=663448&r2=663449&view=diff == --- struts/struts1/trunk/apps/blank/pom.xml (original) +++ struts/struts1/trunk/apps/blank/pom.xml Wed Jun 4 21:54:49 2008 @@ -51,8 +51,6 @@ javax.servlet servlet-api - 2.3 - provided Modified: struts/struts1/trunk/apps/cookbook/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/cookbook/pom.xml?rev=663449&r1=663448&r2=663449&view=diff == --- struts/struts1/trunk/apps/cookbook/pom.xml (original) +++ struts/struts1/trunk/apps/cookbook/pom.xml Wed Jun 4 21:54:49 2008 @@ -44,16 +44,14 @@ ${pom.version} - javax.servlet - servlet-api - 2.3 - provided - - ${pom.groupId} struts-taglib ${pom.version} + + javax.servlet + servlet-api + Modified: struts/struts1/trunk/apps/el-example/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/el-example/pom.xml?rev=663449&r1=663448&r2=663449&view=diff == --- struts/struts1/trunk/apps/el-example/pom.xml (original) +++ struts/struts1/trunk/apps/el-example/pom.xml Wed Jun 4 21:54:49 2008 @@ -46,8 +46,6 @@ javax.servlet servlet-api - 2.3 - provided Modified: struts/struts1/trunk/apps/examples/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/examples/pom.xml?rev=663449&r1=663448&r2=663449&view=diff == --- struts/struts1/trunk/apps/examples/pom.xml (original) +++ struts/struts1/trunk/apps/examples/pom.xml Wed Jun 4 21:54:49 2008 @@ -49,26 +49,21 @@ ${pom.version} - javax.servlet - servlet-api - 2.3 - provided + commons-fileupload + commons-fileupload javax.servlet jstl - 1.0.6 + + + javax.servlet + servlet-api taglibs standard - 1.0.6 - - commons-fileupload - commons-fileupload - 1.1.1 - Modified: struts/struts1/trunk/apps/faces-example1/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/faces-example1/pom.xml?rev=663449&r1=663448&r2=663449&view=diff == --- struts/struts1/trunk/apps/faces-example1/pom.xml (original) +++ struts/struts1/trunk/apps/faces-example1/pom.xml Wed Jun 4 21:54:49 2008 @@ -45,48 +45,38 @@ javax.servlet + jstl + + + javax.servlet servlet-api - 2.3 - provided myfaces myfaces-impl - 1.0.9 + ${myfaces.version} myfaces myfaces-extensions - 1.0.9 myfaces myfaces-jsf-api - 1.0.9 - - - javax.servlet - jstl - 1.0.2 taglibs standard - 1.0.2 - commons-codec commons-codec - 1.2 commons-el commons-el - 1.0 - Modified: struts/struts1/trunk/apps/faces-example2/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps
svn commit: r663455 - in /struts/struts1/branches/STRUTS_1_3_BRANCH: apps/faces-example1/pom.xml apps/faces-example2/pom.xml el/pom.xml
Author: pbenedict Date: Wed Jun 4 22:40:30 2008 New Revision: 663455 URL: http://svn.apache.org/viewvc?rev=663455&view=rev Log: STR-3134: Upgrade JSTL impl to 1.0.6 Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/apps/faces-example1/pom.xml struts/struts1/branches/STRUTS_1_3_BRANCH/apps/faces-example2/pom.xml struts/struts1/branches/STRUTS_1_3_BRANCH/el/pom.xml Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/apps/faces-example1/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/apps/faces-example1/pom.xml?rev=663455&r1=663454&r2=663455&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/apps/faces-example1/pom.xml (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/apps/faces-example1/pom.xml Wed Jun 4 22:40:30 2008 @@ -72,7 +72,7 @@ taglibs standard - 1.0.2 + 1.0.6 Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/apps/faces-example2/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/apps/faces-example2/pom.xml?rev=663455&r1=663454&r2=663455&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/apps/faces-example2/pom.xml (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/apps/faces-example2/pom.xml Wed Jun 4 22:40:30 2008 @@ -72,7 +72,7 @@ taglibs standard - 1.0.2 + 1.0.6 Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/el/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/el/pom.xml?rev=663455&r1=663454&r2=663455&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/el/pom.xml (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/el/pom.xml Wed Jun 4 22:40:30 2008 @@ -93,7 +93,7 @@ taglibs standard - 1.0.2 + 1.0.6
svn commit: r663456 - /struts/struts1/trunk/pom.xml
Author: pbenedict Date: Wed Jun 4 22:40:33 2008 New Revision: 663456 URL: http://svn.apache.org/viewvc?rev=663456&view=rev Log: STR-3134: Upgrade JSTL impl to 1.0.6 Modified: struts/struts1/trunk/pom.xml Modified: struts/struts1/trunk/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/pom.xml?rev=663456&r1=663455&r2=663456&view=diff == --- struts/struts1/trunk/pom.xml (original) +++ struts/struts1/trunk/pom.xml Wed Jun 4 22:40:33 2008 @@ -390,7 +390,7 @@ taglibs standard - 1.0.2 + 1.0.6
svn commit: r663460 - /struts/struts1/trunk/pom.xml
Author: pbenedict Date: Wed Jun 4 22:52:14 2008 New Revision: 663460 URL: http://svn.apache.org/viewvc?rev=663460&view=rev Log: STR-3059: Bump Commons FileUpload to 1.2.1 Modified: struts/struts1/trunk/pom.xml Modified: struts/struts1/trunk/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/pom.xml?rev=663460&r1=663459&r2=663460&view=diff == --- struts/struts1/trunk/pom.xml (original) +++ struts/struts1/trunk/pom.xml Wed Jun 4 22:52:14 2008 @@ -325,7 +325,7 @@ commons-fileupload commons-fileupload -1.2 +1.2.1 true
svn commit: r663836 - in /struts/struts1/trunk/taglib/src/main: java/org/apache/struts/taglib/html/MessagesTag.java java/org/apache/struts/taglib/logic/MessagesPresentTag.java resources/META-INF/tld/s
Author: pbenedict Date: Thu Jun 5 23:19:40 2008 New Revision: 663836 URL: http://svn.apache.org/viewvc?rev=663836&view=rev Log: STR-2913: Expose count of messages as page attribute Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/MessagesPresentTag.java struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-logic.tld Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java?rev=663836&r1=663835&r2=663836&view=diff == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/MessagesTag.java Thu Jun 5 23:19:40 2008 @@ -102,6 +102,12 @@ * will be used to retrieve the messages from scope. */ protected String message = null; + +/** + * The name of the page-scoped attribute to be populated + * with the message count of the specifie dproperty. + */ +protected String count; /** * Filter the message replacement values for characters that are @@ -180,6 +186,14 @@ public void setFilterArgs(boolean filterArgs) { this.filterArgs = filterArgs; } + +public void setCount(String count) { + this.count = count; +} + +public String getCount() { + return count; +} /** * Construct an iterator for the specified collection, and begin looping @@ -210,9 +224,20 @@ } // Acquire the collection we are going to iterate over -this.iterator = -(property == null) ? messages.get() : messages.get(property); - +int size; +if (property == null) { + this.iterator = messages.get(); + size = messages.size(); +} else { + this.iterator = messages.get(property); + size = messages.size(property); +} + +// Expose the count when specified +if (count != null) { + pageContext.setAttribute(count, new Integer(size)); +} + // Store the first value and evaluate, or skip the body if none if (!this.iterator.hasNext()) { return SKIP_BODY; @@ -335,6 +360,10 @@ } } + if (count != null) { +pageContext.removeAttribute(count); + } + return EVAL_PAGE; } @@ -354,5 +383,6 @@ footer = null; message = null; filterArgs = false; +count = null; } } Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/MessagesPresentTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/MessagesPresentTag.java?rev=663836&r1=663835&r2=663836&view=diff == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/MessagesPresentTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/MessagesPresentTag.java Thu Jun 5 23:19:40 2008 @@ -39,12 +39,19 @@ * @since Struts 1.1 */ public class MessagesPresentTag extends ConditionalTagBase { -/** + + /** * If this is set to 'true', then the Globals.MESSAGE_KEY * will be used to retrieve the messages from scope. */ protected String message = null; +/** + * The name of the page-scoped attribute to be populated + * with the message count of the specifie dproperty. + */ +protected String count; + public MessagesPresentTag() { name = Globals.ERROR_KEY; } @@ -57,6 +64,14 @@ this.message = message; } +public void setCount(String count) { + this.count = count; +} + +public String getCount() { + return count; +} + /** * Evaluate the condition that is being tested by this particular tag, and * return true if the nested body content of this tag should @@ -94,11 +109,32 @@ throw e; } -Iterator iterator = (property == null) ? am.get() : am.get(property); +// Acquire the collection of messages +Iterator iterator; +int size; +if (property == null) { + iterator = am.get(); + size = am.size(); +} else { +iterator = am.get(property); +size = am.size(property); +} +// Expose the count whe
svn commit: r664382 - in /struts/struts1/trunk: core/src/main/java/org/apache/struts/action/ extras/src/main/java/org/apache/struts/actions/ faces/src/main/java/org/apache/struts/faces/application/ fa
Author: pbenedict Date: Sat Jun 7 13:45:12 2008 New Revision: 664382 URL: http://svn.apache.org/viewvc?rev=664382&view=rev Log: STR-3119: Add root cause to thrown exceptions that do not accept root cause in the constructor Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java struts/struts1/trunk/core/src/main/java/org/apache/struts/action/DynaActionFormClass.java struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/ActionDispatcher.java struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/DispatchAction.java struts/struts1/trunk/faces/src/main/java/org/apache/struts/faces/application/ActionListenerImpl.java struts/struts1/trunk/faces/src/main/java/org/apache/struts/faces/component/FormComponent.java struts/struts1/trunk/faces/src/main/java/org/apache/struts/faces/taglib/JavascriptValidatorTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/WriteTag.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/OptionsCollectionTag.java struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/ComponentDefinition.java struts/struts1/trunk/tiles/src/main/java/org/apache/struts/tiles/TilesPlugin.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java?rev=664382&r1=664381&r2=664382&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionServlet.java Sat Jun 7 13:45:12 2008 @@ -401,7 +401,9 @@ + "unexpected exception or error thrown, so marking the " + "servlet as unavailable. Most likely, this is due to an " + "incorrect or missing library dependency.", t); -throw new UnavailableException(t.getMessage()); +UnavailableException t2 = new UnavailableException(t.getMessage()); +t2.initCause(t); +throw t2; } } @@ -613,10 +615,11 @@ (RequestProcessor) RequestUtils.applicationInstance(config.getControllerConfig() .getProcessorClass()); } catch (Exception e) { -throw new UnavailableException( + UnavailableException e2 = new UnavailableException( "Cannot initialize RequestProcessor of class " -+ config.getControllerConfig().getProcessorClass() + ": " -+ e); ++ config.getControllerConfig().getProcessorClass()); +e2.initCause(e); +throw e2; } // Emit a warning to the log if the classic RequestProcessor is @@ -769,7 +772,9 @@ String msg = internal.getMessage("configParse", path); log.error(msg, e); -throw new UnavailableException(msg); +UnavailableException e2 = new UnavailableException(msg); +e2.initCause(e); +throw e2; } /** @@ -786,7 +791,9 @@ internal.getMessage("configExtends.creation", className); log.error(errorMessage, e); -throw new UnavailableException(errorMessage); +UnavailableException e2 = new UnavailableException(errorMessage); +e2.initCause(e); +throw e2; } /** @@ -805,7 +812,9 @@ internal.getMessage("configExtends", configType, configName); log.error(errorMessage, e); -throw new UnavailableException(errorMessage); +UnavailableException e2 = new UnavailableException(errorMessage); +e2.initCause(e); +throw e2; } /** @@ -888,7 +897,9 @@ plugInConfigs[i].getClassName()); log(errMsg, e); -throw new UnavailableException(errMsg); +UnavailableException e2 = new UnavailableException(errMsg); +e2.initCause(e); +throw e2; } } } @@ -1691,8 +1702,10 @@ } catch (MissingResourceException e) { log.error("Cannot load internal resources from '" + internalName + "'", e); -throw new UnavailableException( +UnavailableException e2 = new UnavailableException( "Cannot load internal resources from '" + internalName + "'"); +e2.initCause(e); +throw e2; } } Modified: struts/s
svn commit: r664420 - in /struts/struts1/trunk/core/src/main: java/org/apache/struts/action/ java/org/apache/struts/util/ java/org/apache/struts/validator/ resources/org/apache/struts/action/ resource
Author: pbenedict Date: Sat Jun 7 18:03:36 2008 New Revision: 664420 URL: http://svn.apache.org/viewvc?rev=664420&view=rev Log: Move property files into standard Maven resources folder Added: struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/ struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/ActionResources.properties - copied unchanged from r664382, struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/ActionResources_ja.properties - copied unchanged from r664382, struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/LocalStrings.properties - copied unchanged from r664382, struts/struts1/trunk/core/src/main/java/org/apache/struts/action/LocalStrings.properties struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/LocalStrings_ja.properties - copied unchanged from r664382, struts/struts1/trunk/core/src/main/java/org/apache/struts/action/LocalStrings_ja.properties struts/struts1/trunk/core/src/main/resources/org/apache/struts/util/ struts/struts1/trunk/core/src/main/resources/org/apache/struts/util/LocalStrings.properties - copied unchanged from r664382, struts/struts1/trunk/core/src/main/java/org/apache/struts/util/LocalStrings.properties struts/struts1/trunk/core/src/main/resources/org/apache/struts/util/LocalStrings_ja.properties - copied unchanged from r664382, struts/struts1/trunk/core/src/main/java/org/apache/struts/util/LocalStrings_ja.properties struts/struts1/trunk/core/src/main/resources/org/apache/struts/validator/LocalStrings.properties - copied unchanged from r664382, struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/LocalStrings.properties Removed: struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources.properties struts/struts1/trunk/core/src/main/java/org/apache/struts/action/ActionResources_ja.properties struts/struts1/trunk/core/src/main/java/org/apache/struts/action/LocalStrings.properties struts/struts1/trunk/core/src/main/java/org/apache/struts/action/LocalStrings_ja.properties struts/struts1/trunk/core/src/main/java/org/apache/struts/util/LocalStrings.properties struts/struts1/trunk/core/src/main/java/org/apache/struts/util/LocalStrings_ja.properties struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/LocalStrings.properties
svn commit: r664421 - in /struts/struts1/trunk/extras/src/main: java/org/apache/struts/actions/ resources/org/ resources/org/apache/ resources/org/apache/struts/ resources/org/apache/struts/actions/
Author: pbenedict Date: Sat Jun 7 18:12:04 2008 New Revision: 664421 URL: http://svn.apache.org/viewvc?rev=664421&view=rev Log: Move property files into standard Maven resources folder (extras) Added: struts/struts1/trunk/extras/src/main/resources/org/ struts/struts1/trunk/extras/src/main/resources/org/apache/ struts/struts1/trunk/extras/src/main/resources/org/apache/struts/ struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/ struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/LocalStrings.properties - copied unchanged from r664382, struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/LocalStrings.properties struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/LocalStrings_ja.properties - copied unchanged from r664382, struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/LocalStrings_ja.properties Removed: struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/LocalStrings.properties struts/struts1/trunk/extras/src/main/java/org/apache/struts/actions/LocalStrings_ja.properties
svn commit: r664422 - in /struts/struts1/trunk/taglib/src/main: java/org/apache/struts/taglib/ java/org/apache/struts/taglib/bean/ java/org/apache/struts/taglib/html/ java/org/apache/struts/taglib/log
Author: pbenedict Date: Sat Jun 7 18:13:02 2008 New Revision: 664422 URL: http://svn.apache.org/viewvc?rev=664422&view=rev Log: Move property files into standard Maven resources folder (taglib) Added: struts/struts1/trunk/taglib/src/main/resources/org/ struts/struts1/trunk/taglib/src/main/resources/org/apache/ struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/ struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/ struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/LocalStrings.properties - copied unchanged from r664382, struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/LocalStrings.properties struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/LocalStrings_ja.properties - copied unchanged from r664382, struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/LocalStrings_ja.properties struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/bean/ struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/bean/LocalStrings.properties - copied unchanged from r664382, struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings.properties struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/bean/LocalStrings_ja.properties - copied unchanged from r664382, struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings_ja.properties struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/html/ struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/html/LocalStrings.properties - copied unchanged from r664382, struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/html/LocalStrings_ja.properties - copied unchanged from r664382, struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings_ja.properties struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/ struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings.properties - copied unchanged from r664382, struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/LocalStrings.properties struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings_ja.properties - copied unchanged from r664382, struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/LocalStrings_ja.properties Removed: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/LocalStrings.properties struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/LocalStrings_ja.properties struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings.properties struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/bean/LocalStrings_ja.properties struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings.properties struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/LocalStrings_ja.properties struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/LocalStrings.properties struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/LocalStrings_ja.properties
svn commit: r664428 - in /struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib: LocalStrings_es.properties bean/LocalStrings_es.properties html/LocalStrings_es.properties logic/Loca
Author: pbenedict Date: Sat Jun 7 20:43:49 2008 New Revision: 664428 URL: http://svn.apache.org/viewvc?rev=664428&view=rev Log: STR-2013: Add Spanish translations Added: struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/LocalStrings_es.properties (with props) struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/bean/LocalStrings_es.properties (with props) struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/html/LocalStrings_es.properties (with props) struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings_es.properties (with props) Added: struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/LocalStrings_es.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/LocalStrings_es.properties?rev=664428&view=auto == --- struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/LocalStrings_es.properties (added) +++ struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/LocalStrings_es.properties Sat Jun 7 20:43:49 2008 @@ -0,0 +1,30 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +actionErrors.errors=No puedo procesar instanca de ActionErrors de clase {0} +actionMessages.errors=No puedo procesar instancia de ActionMessages de clase {0} +computeURL.forward=No puedo recuperar ActionForward llamado {0} +computeURL.specifier=Debes de especificar exáctamente uno de entre "forward", "href", "page" o "action" +lookup.access=Acceso inválido buscando propiedad {0} de bean {1} + +lookup.bean.any=No puedo hallar bean {0} en cualquier ámbito +lookup.bean=No puedo hallar bean {0} en ámbito {1} +lookup.method=no hay método getter para propiedad {0} de bean {1} +lookup.scope=Ámbito de bean inválido {0} +lookup.target=Lanzada excepción por getter de propiedad {0} de bean {1} +message.message=Falta mensaje para clave {0} en paquete {1} para local {2} +message.bundle=No puedo hallar recursos de mensaje bajo la clave {0} +parameters.multi=No puedo cambiar a Map para nombre={0} propiedad={1} ámbito={2} +write.io=Error de Entrada/Salida: {0} Propchange: struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/LocalStrings_es.properties -- svn:eol-style = native Propchange: struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/LocalStrings_es.properties -- svn:keywords = Date Author Id Revision HeadURL Added: struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/bean/LocalStrings_es.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/bean/LocalStrings_es.properties?rev=664428&view=auto == --- struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/bean/LocalStrings_es.properties (added) +++ struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/bean/LocalStrings_es.properties Sat Jun 7 20:43:49 2008 @@ -0,0 +1,37 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governi
svn commit: r664429 - /struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/LocalStrings_es.properties
Author: pbenedict Date: Sat Jun 7 20:43:54 2008 New Revision: 664429 URL: http://svn.apache.org/viewvc?rev=664429&view=rev Log: STR-2013: Add Spanish translations Added: struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/LocalStrings_es.properties (with props) Added: struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/LocalStrings_es.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/LocalStrings_es.properties?rev=664429&view=auto == --- struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/LocalStrings_es.properties (added) +++ struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/LocalStrings_es.properties Sat Jun 7 20:43:54 2008 @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +dispatch.error=Dispatch[{0}] a método '{1}' devolvión una excepción +dispatch.handler=DispatchMapping[{0}] no define un manejador adecuádamente +dispatch.recursive=No uses 'execute' o 'perform' con DispatchAction. +dispatch.lookup=Action[{0}] no contiene manejador para recurso '{1}' +dispatch.mapping=ActionMapping[{0}] no es del tipo DispatchMapping +dispatch.method=Action[{0}] no contiene método llamado '{1}' + +dispatch.parameter=Request[{0}] no contiene parámetro de manejador llamado '{1}'. Esto puede ser causado por un espacio en blanco en texto de la etiqueta. + +dispatch.return=Action[{0}] tipo de retorno inválido para método '{1}' +dispatch.resource=Action[{0}] falta recurso '{1}' en mapa de métido clave +forward.path=No se ha especificado URI relativa-a-contexto a través del atributo 'parameter' +forward.rd=No puedo crear despachador de requerimiento para trayectoria '{0}' +include.path=No se ha especificado URI relativa-a-contexto a través del atributo 'parameter' +include.rd=No puedo crear despachador de requerimiento para trayectoria '{0}' +switch.prefix=Se ha especificado un prefijo de módulo '{0}' inválido +switch.required=El conmutador requiere ambos parámetros de requerimiento 'prefix' y 'page' +success.required=SuccessAction no pudo hallar una ActionForward llamada 'success' para trayectoria '{0}' +mapping.parameter=ActionMapping[{0}] no define un atributo 'parameter' Propchange: struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/LocalStrings_es.properties -- svn:eol-style = native Propchange: struts/struts1/trunk/extras/src/main/resources/org/apache/struts/actions/LocalStrings_es.properties -- svn:keywords = Date Author Id Revision HeadURL
svn commit: r664430 - /struts/struts1/trunk/apps/examples/src/main/java/org/apache/struts/webapp/validator/MessageResources_es.properties
Author: pbenedict Date: Sat Jun 7 20:43:59 2008 New Revision: 664430 URL: http://svn.apache.org/viewvc?rev=664430&view=rev Log: STR-2013: Add Spanish translations Added: struts/struts1/trunk/apps/examples/src/main/java/org/apache/struts/webapp/validator/MessageResources_es.properties (with props) Added: struts/struts1/trunk/apps/examples/src/main/java/org/apache/struts/webapp/validator/MessageResources_es.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/apps/examples/src/main/java/org/apache/struts/webapp/validator/MessageResources_es.properties?rev=664430&view=auto == --- struts/struts1/trunk/apps/examples/src/main/java/org/apache/struts/webapp/validator/MessageResources_es.properties (added) +++ struts/struts1/trunk/apps/examples/src/main/java/org/apache/struts/webapp/validator/MessageResources_es.properties Sat Jun 7 20:43:59 2008 @@ -0,0 +1,110 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +button.cancel=Cancelar +button.confirm=Confirmar +button.reset=Limpiar +button.save=Salvar + +# Errors +errors.footer= +errors.header=Error de ValidaciónDebes de corregir los siguientes errores antes de proseguir: +errors.ioException=Excepción de E/S generando mensajes de error: {0} +error.database.missing=Falta la base de datos de Usuario, no puedo validar credenciales de logon +errors.required={0} es requerido. +errors.minlength={0} no puede ser menor de {1} caracteres. +errors.maxlength={0} no puede ser mayor de {1} caracteres. +errors.invalid={0} es inválido. + +errors.byte={0} debe de ser un byte. +errors.short={0} debe de ser un short. +errors.integer={0} debe de ser un integer. +errors.long={0} debe de ser un long. +errors.float={0} debe de ser un float. +errors.double={0} debe de ser un double. + +errors.date={0} no es una fecha. + +errors.range={0} no está en el rango desde {1} hasta {2}. + +errors.creditcard={0} no es un número de tarjeta de crédito válido. + +errors.email={0} no es una dirección de e-mail válida. + + +# Index Page +index.title=Validador de Struts +index.power=Potenciado mediante Struts + +# Registration Form +registrationForm.title=Registro +registrationForm.title.create=Registrar +registrationForm.title.edit=Editar Información de Usuario +registrationForm.firstname.displayname=Nombre +registrationForm.lastname.displayname=Apellidos +registrationForm.addr.displayname=Dirección +registrationForm.city.displayname=Ciudad +registrationForm.stateprov.displayname=Provincia +registrationForm.zippostal.displayname=C.P. +registrationForm.phone.displayname=Teléfono +registrationForm.email.displayname=E-mail +registrationForm.lastname.maskmsg=Los Apellidos sólo pueden ser letras, sin espacios. + +# JavaScript Registration Form +jsRegistrationForm.title=Formulario de Registro JavaScript +jsRegistrationForm.description=con validación cliente mediante JavaScript y validación en servidor + +# Muli-page Registration Form +multiRegistrationForm.title=Formulario de Registro Multi-página +multiRegistrationForm.description=ejemplo mlti-página con validación cliente mediante JavaScript y validación en servidor + +# Type form + +typeForm.byte.displayname=Campo Byte +typeForm.checkbox.wouldrecommend=Recomendaría +typeForm.checkbox.used.languages=Lenguajes de Programación usados +typeForm.creditCard.displayname=Tarjeta de Crédito +typeForm.date.displayname=Campo de Fecha +typeForm.description=Ejemplo validando alguno número primitivos, un rango de campos enteros, una fecha y una tarjeta de crédito. +typeForm.double.displayname=Campo Double +typeForm.float.displayname=Campo Float +typeForm.floatRange.displayname=Campo de Rango Float +typeForm.integer.displayname=Campo Integer + + + + + +typeForm.long.displayname=Campo Long +typeForm.nested.name.displayname=Nombre +typeForm.nested=Texto Anidado +typeForm.option.os.list=Sistema Operativo en uso +typeForm.option.satisfaction=Satisfacción +typeForm.option.select.many=<Selecciona una o más> +typeForm.option.select.one=<Selecciona Una> +typeForm.radio.overall.satisfaction=Satisfacción General +typeForm.short.displayname=Campo Short +typeForm.titl
svn commit: r664431 - in /struts/struts1/trunk/core/src/main/resources/org/apache/struts: action/ActionResources_es.properties action/LocalStrings_es.properties util/LocalStrings_es.properties
Author: pbenedict Date: Sat Jun 7 20:44:05 2008 New Revision: 664431 URL: http://svn.apache.org/viewvc?rev=664431&view=rev Log: STR-2013: Add Spanish translations Added: struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/ActionResources_es.properties (with props) struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/LocalStrings_es.properties (with props) struts/struts1/trunk/core/src/main/resources/org/apache/struts/util/LocalStrings_es.properties (with props) Added: struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/ActionResources_es.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/ActionResources_es.properties?rev=664431&view=auto == --- struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/ActionResources_es.properties (added) +++ struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/ActionResources_es.properties Sat Jun 7 20:44:05 2008 @@ -0,0 +1,54 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +actionCreate=No se pudo crear instancia de acción para trayectoria {0} + +applicationLoading=Cargando recursos de apliacación desde recurso {0} +applicationResources=No puedo cargar paquete de recursos de aplicación {0} +configCompleted=Se ha completado la verificación de ModuleConfig + + +configFatal=Error fatal de configuración de módulo, mira los mensajes previos + +configInit=Inicializando configuración desde trayectoria de recurso {0} +configIO=Error de entrada/salida leyendo configuración desde trayectoria de recurso {0} +configMapping=Configurando mapeo para trayectoria {0} +configMissing=Falta recurso de configuración para trayectoria {0} +configParse=Error sintáctico procesando trayectoria de recurso {0} +configVerifying=Verificando ModuleConfig para este módulo +configWebXml=No se halló el /WEB-INF/web.xml +finalizing=Finalizando este servlet de controlador +formBean=Error creando bean de formulario de clase {0} + +initProcessor=Excepción inicializando RequestProcessor + +mappingType=Debes de especificar una de "forward", "include" o "type" para trayectoria {0} +notAuthorized=El usuario no está autorizado a acceder a acción {0} +noInput=No hay atributo de entrada para trayectoria de mapeo {0} +processInvalid=Se requirió una trayectoria inválida {0} +processPath=No se halló trayectoria de proceso en URI de requerimiento {0} +reloading=Volviendo a cargar desde archivos de configuración +requestDispatcher=no puedo obtener despachador de requerimiento para trayectoria {0} +sessionCreate=No se pudo crear sesión de usuario +unhandledException=Lanzada excepción no manejable: {0} +verifyActionMappingClass.invalid=Especificada clase ActionMapping inválida {0} +verifyActionMappingClass.missing=No se ha especificado clase de implementación ActionMapping +verifyForwardConfig.invalid=Trayectorai inválida {0} para ForwardConfig {1} +verifyForwardConfig.missing=Falta trayectoria para ForwardConfig {0} +verifyMessageResourcesConfigs.invalid=Clase de fábrica inválida {0} para MessageResourcesConfig +verifyMessageResourcesConfigs.key=No hay atribtuto clave para MessageResourcesConfig +verifyMessageResourcesConfigs.missing=No hay atributo de fábrica para MessageResourcesConfig +verifyPlugInConfigs.invalid=className {0} inválido para PlugInConfig +verifyPlugInConfigs.missing=No hay atributo className para PlugInConfig Propchange: struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/ActionResources_es.properties -- svn:eol-style = native Propchange: struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/ActionResources_es.properties -- svn:keywords = Date Author Id Revision HeadURL Added: struts/struts1/trunk/core/src/main/resources/org/apache/struts/action/LocalStrings_es.properties URL: http://svn.apache.org/viewvc/struts/stru
svn commit: r664433 - /struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld
Author: pbenedict Date: Sat Jun 7 21:00:20 2008 New Revision: 664433 URL: http://svn.apache.org/viewvc?rev=664433&view=rev Log: STR-1638: Note that anchor cannot be standalone. Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Modified: struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld?rev=664433&r1=664432&r2=664433&view=diff == --- struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld (original) +++ struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Sat Jun 7 21:00:20 2008 @@ -4792,7 +4792,9 @@
svn commit: r664435 - in /struts/struts1/trunk/taglib/src/main: java/org/apache/struts/taglib/logic/IterateTag.java resources/org/apache/struts/taglib/logic/LocalStrings.properties resources/org/apach
Author: pbenedict Date: Sat Jun 7 21:14:46 2008 New Revision: 664435 URL: http://svn.apache.org/viewvc?rev=664435&view=rev Log: STR-2153: Reveal the offending bean and property name when iterating Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/IterateTag.java struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings.properties struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings_es.properties Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/IterateTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/IterateTag.java?rev=664435&r1=664434&r2=664435&view=diff == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/IterateTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/logic/IterateTag.java Sat Jun 7 21:14:46 2008 @@ -240,7 +240,8 @@ if (collection == null) { JspException e = -new JspException(messages.getMessage("iterate.collection")); +new JspException(messages.getMessage("iterate.collection", + name, property)); TagUtils.getInstance().saveException(pageContext, e); throw e; @@ -273,7 +274,8 @@ iterator = new IteratorAdapter((Enumeration) collection); } else { JspException e = -new JspException(messages.getMessage("iterate.iterator")); +new JspException(messages.getMessage("iterate.iterator", name, + property, collection.getClass().getName())); TagUtils.getInstance().saveException(pageContext, e); throw e; Modified: struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings.properties?rev=664435&r1=664434&r2=664435&view=diff == --- struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings.properties (original) +++ struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings.properties Sat Jun 7 21:14:46 2008 @@ -17,8 +17,8 @@ forward.forward=Exception forwarding for name {0}: {1} forward.lookup=Cannot find global ActionForward for name {0} forward.redirect=Exception redirecting for name {0}: {1} -iterate.collection=No collection found -iterate.iterator=Cannot create iterator for this collection +iterate.collection=No collection found for name {0} property {1} +iterate.iterator=Cannot create iterator for collection name {0} property {1}: {2} logic.bean=No bean found under attribute key {0} logic.property=Exception accessing property {1} for bean {0}: {2} logic.selector=No selector attribute (cookie/header/name/parameter) was specified Modified: struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings_es.properties URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings_es.properties?rev=664435&r1=664434&r2=664435&view=diff == --- struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings_es.properties (original) +++ struts/struts1/trunk/taglib/src/main/resources/org/apache/struts/taglib/logic/LocalStrings_es.properties Sat Jun 7 21:14:46 2008 @@ -17,8 +17,8 @@ forward.forward=Excepción reenviando para nombre {0}: {1} forward.lookup=No puedo hallar ActionForward global para nombre {0} forward.redirect=Excepción redirigiendo para nombre {0}: {1} -iterate.collection=No se ha hallado la colección -iterate.iterator=No puedo crear iterator para esta colección +iterate.collection=No se ha hallado la colección para nombre {0} propiedad {1} +iterate.iterator=No puedo crear iterator para esta colección para nombre {0} propiedad {1}: {2} logic.bean=No se ha hallado bean bajo clave de atributo {0} logic.property=Excepción accediendo a propiedad {1} para bean {0}: {2} logic.selector=No se ha especificado atributo de selector (cookie/header/name/parameter)
svn commit: r664540 - /struts/struts1/trunk/pom.xml
Author: pbenedict Date: Sun Jun 8 12:22:28 2008 New Revision: 664540 URL: http://svn.apache.org/viewvc?rev=664540&view=rev Log: STR-3153: Faces and EL projects moved to build profile Modified: struts/struts1/trunk/pom.xml Modified: struts/struts1/trunk/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/pom.xml?rev=664540&r1=664539&r2=664540&view=diff == --- struts/struts1/trunk/pom.xml (original) +++ struts/struts1/trunk/pom.xml Sun Jun 8 12:22:28 2008 @@ -70,6 +70,18 @@ +dormant + + +dormant + + + +el +faces + + + itest @@ -120,9 +132,7 @@ core -el extras -faces mailreader-dao scripting taglib
svn commit: r664558 - /struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java
Author: pbenedict Date: Sun Jun 8 14:28:09 2008 New Revision: 664558 URL: http://svn.apache.org/viewvc?rev=664558&view=rev Log: STR-2740: Support XHTML versions Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java Modified: struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java?rev=664558&r1=664557&r2=664558&view=diff == --- struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java (original) +++ struts/struts1/trunk/core/src/main/java/org/apache/struts/Globals.java Sun Jun 8 14:28:09 2008 @@ -197,6 +197,15 @@ public static final String XHTML_KEY = "org.apache.struts.globals.XHTML"; /** + * The request attributes key under which XHTML version is stored. The + * version is stored as a [EMAIL PROTECTED] java.math.BigDecimal}. The attribute + * has no effect if [EMAIL PROTECTED] #XHTML_KEY} is not set. + * + * @since Struts 1.4 + */ +public static final String XHTML_VERSION_KEY = "org.apache.struts.globals.XHTML_VERSION"; + +/** * The name of the taglib package. */ public static final String TAGLIB_PACKAGE = "org.apache.struts.taglib.html";
svn commit: r664559 - in /struts/struts1/trunk/taglib/src/main: java/org/apache/struts/taglib/TagUtils.java java/org/apache/struts/taglib/html/HtmlTag.java resources/META-INF/tld/struts-html.tld
Author: pbenedict Date: Sun Jun 8 14:28:14 2008 New Revision: 664559 URL: http://svn.apache.org/viewvc?rev=664559&view=rev Log: STR-2740: Support XHTML versions Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/TagUtils.java struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java struts/struts1/trunk/taglib/src/main/resources/META-INF/tld/struts-html.tld Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/TagUtils.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/TagUtils.java?rev=664559&r1=664558&r2=664559&view=diff == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/TagUtils.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/TagUtils.java Sun Jun 8 14:28:14 2008 @@ -48,6 +48,8 @@ import java.lang.reflect.InvocationTargetException; +import java.math.BigDecimal; + import java.net.MalformedURLException; import java.util.HashMap; @@ -62,7 +64,44 @@ * @since Struts 1.2 */ public class TagUtils { -/** + + /** +* Constant for +* http://www.w3.org/TR/xhtml1/#docconf";>XHTML 1.0 +* conformance. +* +* @since Struts 1.4 +*/ + public static final BigDecimal XHTML_1_0 = new BigDecimal("1.0"); + + /** +* Constant for +* http://www.w3.org/TR/xhtml11/conformance.html";>XHTML 1.1 +* conformance. +* +* @since Struts 1.4 +*/ + public static final BigDecimal XHTML_1_1 = new BigDecimal("1.1"); + + /** +* Constant for +* http://www.w3.org/TR/xhtml2/conformance.html#s_conform";>XHTML +* 2.0 conformance. +* +* @since Struts 1.4 +*/ + public static final BigDecimal XHTML_2_0 = new BigDecimal("2.0"); + + /** +* Constant for +* http://www.w3.org/html/wg/html5/#terminology";>XHTML 5.0 +* conformance. +* +* @since Struts 1.4 +*/ + public static final BigDecimal XHTML_5_0 = new BigDecimal("5.0"); + + /** * The Singleton instance. * @since 1.3.5 Changed to non-final so it may be overridden, use at your own risk (you've been warned!!) */ Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java?rev=664559&r1=664558&r2=664559&view=diff == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java Sun Jun 8 14:28:14 2008 @@ -20,6 +20,8 @@ */ package org.apache.struts.taglib.html; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.struts.Globals; import org.apache.struts.taglib.TagUtils; import org.apache.struts.util.MessageResources; @@ -28,6 +30,7 @@ import javax.servlet.jsp.PageContext; import javax.servlet.jsp.tagext.TagSupport; +import java.math.BigDecimal; import java.util.Locale; /** @@ -41,6 +44,11 @@ // - Properties /** + * Commons Logging instance. + */ +private static Log log = LogFactory.getLog(HtmlTag.class); + + /** * The message resources for this package. */ protected static MessageResources messages = @@ -51,6 +59,13 @@ * Are we rendering an xhtml page? */ protected boolean xhtml = false; + +/** + * What version of XHTML is being rendered? + * + * @since Struts 1.4 + */ +private BigDecimal xhtmlVersion = XHTML_1_0; /** * Are we rendering a lang attribute? @@ -66,6 +81,18 @@ public void setXhtml(boolean xhtml) { this.xhtml = xhtml; } + +public String getXhtmlVersion() { + return this.xhtmlVersion.toString(); +} + +public void setXhtmlVersion(String xhtmlVersion) { + if (xhtmlVersion != null) { + this.xhtmlVersion = new BigDecimal(xhtmlVersion); + } else { + this.xhtmlVersion = XHTML_1_0; + } +} /** * Returns true if the tag should render a lang attribute. @@ -117,23 +144,53 @@ boolean validLanguage = isValidRfc2616(language); boolean validCountry = isValidRfc2616(country); +// XHTML document conformance if (this.xhtml) { this.pageContext.setAttribute(Global
svn commit: r664560 - /struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java
Author: pbenedict Date: Sun Jun 8 14:32:02 2008 New Revision: 664560 URL: http://svn.apache.org/viewvc?rev=664560&view=rev Log: STR-2740: Fix compiler errors Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java Modified: struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java URL: http://svn.apache.org/viewvc/struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java?rev=664560&r1=664559&r2=664560&view=diff == --- struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java (original) +++ struts/struts1/trunk/taglib/src/main/java/org/apache/struts/taglib/html/HtmlTag.java Sun Jun 8 14:32:02 2008 @@ -65,7 +65,7 @@ * * @since Struts 1.4 */ -private BigDecimal xhtmlVersion = XHTML_1_0; +private BigDecimal xhtmlVersion = TagUtils.XHTML_1_0; /** * Are we rendering a lang attribute? @@ -90,7 +90,7 @@ if (xhtmlVersion != null) { this.xhtmlVersion = new BigDecimal(xhtmlVersion); } else { - this.xhtmlVersion = XHTML_1_0; + this.xhtmlVersion = TagUtils.XHTML_1_0; } } @@ -180,7 +180,7 @@ // If language is specified, output the attribute // unless XHTML is version >= 1.1 if (this.lang && validLanguage) { - if (!this.xhtml || (xhtmlVersion.compareTo(XHTML_1_1) < 0)) { + if (!this.xhtml || (xhtmlVersion.compareTo(TagUtils.XHTML_1_1) < 0)) { sb.append(" lang=\""); sb.append(language);
svn commit: r691096 - in /struts/struts1: branches/STRUTS_1_3_BRANCH/core/pom.xml trunk/pom.xml
Author: pbenedict Date: Mon Sep 1 19:39:02 2008 New Revision: 691096 URL: http://svn.apache.org/viewvc?rev=691096&view=rev Log: Upgrade BeanUtils to 1.8 Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/pom.xml struts/struts1/trunk/pom.xml Modified: struts/struts1/branches/STRUTS_1_3_BRANCH/core/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/branches/STRUTS_1_3_BRANCH/core/pom.xml?rev=691096&r1=691095&r2=691096&view=diff == --- struts/struts1/branches/STRUTS_1_3_BRANCH/core/pom.xml (original) +++ struts/struts1/branches/STRUTS_1_3_BRANCH/core/pom.xml Mon Sep 1 19:39:02 2008 @@ -111,7 +111,7 @@ commons-beanutils commons-beanutils -1.7.0 +1.8.0 commons-chain Modified: struts/struts1/trunk/pom.xml URL: http://svn.apache.org/viewvc/struts/struts1/trunk/pom.xml?rev=691096&r1=691095&r2=691096&view=diff == --- struts/struts1/trunk/pom.xml (original) +++ struts/struts1/trunk/pom.xml Mon Sep 1 19:39:02 2008 @@ -335,7 +335,7 @@ commons-beanutils commons-beanutils -1.7.0 +1.8.0 commons-codec