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

NullPointer in com.opensymphony.xwork2.ActionSupport.getLocale

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.5.10
    • 2.5.12
    • Core
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: