Announcement Announcement Module
Collapse
No announcement yet.
ShowCaptionInStatusBarInterceptorFactory NullPointerException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    This issue has been closed.

    Peter

    Comment

    Working...
    X