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

Showcase - view source throws NumberFormatException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.6
    • 2.0.7
    • Example Applications
    • None
    • Showcase

    • Patch

    Description

      I deployed struts2-showcase-2.0.6.war in Tomcat 5.5.20 on Windows.

      Choose 'person manager'
      Choose 'list'
      Choose 'view source' and you get a exception

      java.lang.NumberFormatException: For input string: ""
      java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
      java.lang.Integer.parseInt(Integer.java:468)
      java.lang.Integer.parseInt(Integer.java:497)
      org.apache.struts2.showcase.source.ViewSourceAction.execute(ViewSourceAction.java:86)

      The URL triggering the bug:
      http://localhost:8080/struts2-showcase-2.0.6/viewSource.action?config=&className=org.apache.struts2.showcase.person.ListPeopleAction&page=/person//person/listPeople.ftl

      The problem:
      Is that config parameter on the URL is empty (config=).

      It can be fixed by checing if the parameters are not empty instead of just != null in the ViewSourceAction.java

      Attachments

        1. WW-1804-patch.txt
          1 kB
          Claus Ibsen

        Activity

          People

            husted Ted Husted
            davsclaus Claus Ibsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: