Results 1 to 2 of 2

Thread: ShowCaptionInStatusBarInterceptorFactory NullPointerException

  1. #1
    Join Date
    Jun 2006
    Location
    Linz, Austria (Europe)
    Posts
    30

    Default ShowCaptionInStatusBarInterceptorFactory NullPointerException

    The ShowCaptionInStatusBarInterceptorFactory throws a NullPointerException when configured in the formComponentInterceptorFactory.

    Code:
    private String getCaption( String propertyName ) {
      String caption = formModel.getFieldFace( propertyName ).getCaption();
    
      if( caption.contains( ".caption" ) ) {
        // FIXME dirty hack, otherwise "propertyName.caption" is shown in the
        // status bar
        return null;
      }
      return caption;
    }
    The reason is that the variable caption should be tested for Null in order to prevent the NPE. Alternatively I would be ok (prefer) if with an non-existing caption property the text "propertyName.caption" is returned.
    Configuring the ShowCaptionInStatusBarInterceptorFactory means that I intentionally want to have status bar messages and thus I should provide these properties anyway.
    I have posted this as issue in JIRA but posting this here too for discussion of alternatively returning "propertyName.caption".

    Is there a way to configure the property bundles components such that I can choose whether Null or "propertyName.caption" (i.e. the resource name) is returned (I believe the Struts framework provides such an option)?

    Thanks
    Martin

  2. #2
    Join Date
    Sep 2004
    Location
    Ghent, Belgium
    Posts
    224

    Default

    This issue has been closed.

    Peter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •