Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4740

NullPointer in com.opensymphony.xwork2.ActionSupport.getLocale

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.5.10
    • Fix Version/s: 2.5.12
    • Component/s: Core
    • Labels:
      None

      Description

      After upgrading from 2.5.2 to 2.5.10 I get a NullPointerException when calling getText("myKey") in an utility class like this:

      Example
      public class ListGenerator extends ActionSupport {
      
          public final List<String> getValues() {
              final List<String> result = new ArrayList<>();
      
              result.add(getText("select.header"));
              result.add(getText("register.female"));
              result.add(getText("register.male"));
      
              return result;
          }
      }
      

      java.lang.NullPointerException at com.opensymphony.xwork2.ActionSupport.getLocale(ActionSupport.java:64)

      ....

      ERROR org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception occurred during processing request: java.lang.NullPointerException

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              flyingfischer Markus Fischer
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: