struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Becheanu (JIRA)" <>
Subject [jira] Created: (WW-2827) TextProviderHelper cause a NPE if there is TextProvider object on the stack .
Date Mon, 06 Oct 2008 21:10:37 GMT
TextProviderHelper cause a NPE if there is TextProvider object on the stack .

                 Key: WW-2827
             Project: Struts 2
          Issue Type: Bug
         Environment: Websphere Portal 6.1
            Reporter: Daniel Becheanu

<s:text> tag is blowing up if there is a TextProvider on the stack. Seems like bug was
introduced by the change in revision 647647. The fix is instead of calling getText with null
as default message pattern use the passed in defaultMessage.

Uncaught exception thrown in one of the service methods of the servlet: /WEB-INF/jsp/xxxx/xxxx.jsp.
Exception thrown : java.lang.NullPointerException
	at java.text.MessageFormat.applyPattern(
	at java.text.MessageFormat.<init>(
	at com.opensymphony.xwork2.DefaultTextProvider.getText(
	at com.opensymphony.xwork2.DefaultTextProvider.getText(
	at org.apache.struts2.util.TextProviderHelper.getText(
	at org.apache.struts2.components.Text.end(
	at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(


### Eclipse Workspace Patch 1.0
#P struts2
Index: core/src/main/java/org/apache/struts2/util/
--- core/src/main/java/org/apache/struts2/util/	(revision 702254)
+++ core/src/main/java/org/apache/struts2/util/	(working copy)
@@ -60,7 +60,7 @@
             if (o instanceof TextProvider) {
                 tp = (TextProvider) o;
-                msg = tp.getText(key, null, args, stack);
+                msg = tp.getText(key, defaultMessage, args, stack);

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message