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

Retrieving property Error when rendering submit of type image in debug mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.1
    • 2.2.3
    • Other
    • None
    • JDK 1.5.0_22
      JONAS 4.10.3

    Description

      Problem:
      There is a problem with the <s:submit type="image" src=""> taglib in forms.
      While rendering it generates a java.lang.NullPointerException (see attached log.txt for stacktrace) in debug mode.

      Test:
      To test this behavior you can download the struts2 samples 2.2.1 and modify the form submit tag in struts2-showcase-2.2.1/conversion/enterPersonsInfo.jsp to be a submit of type image.

      Diagnosis:
      This trace is produces by the presence of the freemarker property <@s.property value="parameters.body"/> in template/simple/submit.ftl.

      Solution:
      As seen with Maurizio Cucchiara on Struts (Users/Dev) Mailing list, this body parameter would seem unnecessary, so is a good candidate for removal, though it don't cause any side effect (except for the exception in debug mode).

      Attachments

        1. submit.ftl
          3 kB
          olivier sagit
        2. log.txt
          34 kB
          olivier sagit

        Issue Links

          Activity

            People

              maurizio.cucchiara Maurizio Cucchiara
              osagit olivier sagit
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0.5h
                  0.5h
                  Remaining:
                  Remaining Estimate - 0.5h
                  0.5h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified