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

Restful2ActionMapper has NullPointerException when used with codebehind

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.3
    • None
    • None

    Description

      As described here :

      http://www.nabble.com/-S2--possible-NPE-in-Restful2--tf3022218.html

      The actual error message is :

      java.lang.NullPointerException
      org.apache.struts2.dispatcher.mapper.Restful2ActionMapper.getMapping(Restful2ActionMapper.java:97)
      org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:393)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119)
      com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55)

      This occurs because restful2 doesn't check to see if the mapping returned by the super call in it's getMapping() method is not null before calling getName() on it.

      The patch just adds a check for null, and returns immediately if that's the case.

      Attachments

        1. restful2.patch
          0.7 kB
          Aadi Deshpande

        Activity

          People

            mrdon Donald J. Brown
            cilquirm Aadi Deshpande
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: