You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2004/11/17 11:50:00 UTC
DO NOT REPLY [Bug 32270] New: -
Let JavasvriptValidatorTag use custom MessageResources for i18n texts
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=32270>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=32270
Summary: Let JavasvriptValidatorTag use custom MessageResources
for i18n texts
Product: Struts
Version: 1.2.4
Platform: PC
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Validator Framework
AssignedTo: dev@struts.apache.org
ReportedBy: cb@touristonline.dk
I have a setup where setting a common MessageResources in struts-config.xml
isn't possible. See this user@struts.apache.org thread
http://mail-archives.apache.org/eyebrowse/BrowseList?listName=user@struts.apache.org&by=thread&from=935909
I have researched on JavascriptValidatorTag and MessagesTag and found that
MessagesTag (by TagUtils) is already looking for the MessageResources on the
pageContext, the request and the servletContext (in that order).
There by I can easily override the MessageResources by extending the
RequestProcessor and add the right MessageResources to the request in
processPreprocess(...)
This works for MessagesTag, but not JavascriptValidatorTag because it only looks
in the servletContext (without TagUtils).
The following two patches makes JavascriptValidatorTag use TagUtils too:
src/share/org/apache/struts/taglib/html/JavascriptValidatorTag.java:
414,416c414,417
< (MessageResources) pageContext.getAttribute(
< bundle + config.getPrefix(),
< PageContext.APPLICATION_SCOPE);
---
> TagUtils.getInstance().retrieveMessageResources(
> pageContext,
> bundle,
> false);
src/share/org/apache/struts/taglib/TagUtils.java:
< private MessageResources retrieveMessageResources(
---
> public MessageResources retrieveMessageResources(
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org