Bug #946

Error reporting next to tag does not support custom resources bundles [Delbecq David]

Added by Old User over 13 years ago. Updated 2 months ago.

Status:Nouveau Start date:
Priority:Medium Due date:
Assignee:Old User % Done:

0%

Category:-
Target version:-

Description

[Delbecq David]
In struts, it is possible to generate messages in a form like this:
<html:errors bundle="Publication"/>
where "Publication" has been defined in struct-config.xml, controler element,
<message-resources parameter="resources.MessageResources" null="false" key="Publication"/>

However, fields like
<layout:text property="originatorName" key="publication.emitter"/> are unable to get the key of a resource bundle to use for error messages rendering and for label. This is a big problem on project where a wep application collects jsp from various sub-projects. We need sub-projects to be able to manage their own bundle.

History

Updated by Old User over 13 years ago

[Delbecq David]
Sorry, the label part is indeed rendered using bundle,

but the error part still read from default bundle. Here is a path which corrects the problem:

Index: fr/improve/struts/taglib/layout/field/AbstractLayoutFieldTag.java ===================================================================
RCS file: /struts-layout/Improve Struts-Layout/src/library/fr/improve/struts/taglib/layout/field/AbstractLayoutFieldTag.java,v
retrieving revision 1.20
diff u -r1.20 AbstractLayoutFieldTag.java
--
fr/improve/struts/taglib/layout/field/AbstractLayoutFieldTag.java 10 Feb 2004 09:22:55 -0000 1.20
+++ fr/improve/struts/taglib/layout/field/AbstractLayoutFieldTag.java 26 May 2005 11:04:59 -0000
@ -236,7 +236,7 @ * Retrieve the errors associated with the current property if there are any.
/
private List retrieveErrors() throws JspException {
- return LayoutUtils.retrieveErrors(pageContext, property);
+ return LayoutUtils.retrieveErrors(pageContext, property,getBundle());
}
/
* * Insert the method's description here.
Index: fr/improve/struts/taglib/layout/util/LayoutUtils.java ===================================================================
RCS file: /struts-layout/Improve Struts-Layout/src/library/fr/improve/struts/taglib/layout/util/LayoutUtils.java,v
retrieving revision 1.27
diff u -r1.27 LayoutUtils.java
--
fr/improve/struts/taglib/layout/util/LayoutUtils.java 30 Mar 2005 15:52:10 -0000 1.27
+++ fr/improve/struts/taglib/layout/util/LayoutUtils.java 26 May 2005 11:04:59 -0000
@ -1,5 +1,6 @
package fr.improve.struts.taglib.layout.util;

+import javax.swing.text.rtf.charsets.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
@ -514,10 +515,18 @
context.setAttribute(MenuRepository.MENU_REPOSITORY_KEY, new MenuRepository());
}

+ /**
+ * Returns the errors associated with an input field.
+ /
+ public static List retrieveErrors(PageContext pageContext, String property)
+ throws JspException {
+ return retrieveErrors(pageContext,property,null);
+ }

/
*
- * Returns the errors associated with an input field.
* Returns the errors associated with an input field, using specific bundle.
*/
- public static List retrieveErrors(PageContext pageContext, String property)
+ public static List retrieveErrors(PageContext pageContext, String property, String bundle)
throws JspException {
ActionMessages errors =
(ActionMessages) pageContext.getAttribute(
@ -529,7 +538,9 @
while (iterator != null && iterator.hasNext()) {
ActionMessage report = (ActionMessage) iterator.next();
localizedErrors.add(
- LayoutUtils.getLabel(pageContext, report.getKey(), report.getValues()));
+ bundle==null?
+ LayoutUtils.getLabel(pageContext, report.getKey(), report.getValues()):
+ LayoutUtils.getLabel(pageContext, bundle, report.getKey(), report.getValues(), false));
}
}
return localizedErrors;

Updated by Declan Kershaw 7 months ago

Tagging of the custom with the recourses of the pictures that on the notification bar the tagged notification with appear is trouble me. Every note and some related charts from mhrwriter reviews ID I have tagged on the post that helpful in likes.

Updated by MC Laren 3 months ago

Do you know how to write a persuasive essay? Have a peek at this guide and have some practice! I will be waiting!

Updated by Pierce Warren 3 months ago

You could be allowed to put up manufacturers, except for shortcuts, in the event that they've been recognized not to mention concerning content.
Capital Gains Tax Advice Brighton Accountants

Updated by Roswell Rory 2 months ago

Improve the foundation of the organization is very useful for the user who makes a project for online. Side project > StrutsLayout page very good for me. I get a more information about how to make a simple page of website lie how to create table fields tables etc. You may see australian writings where i can not get the detail about the development work.

Also available in: Atom PDF