Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2300

Cannot use rebuilt struts-blank example; message-resource param in struts-config.xml is wrong.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Incomplete
    • 1.2.4
    • None
    • Example Applications
    • None
    • Operating System: Windows XP
      Platform: PC
    • 32485

    Description

      I downloaded and installed Tomcat 5.5.4.
      I downloaded struts 1.2.4, and dropped the .war files in Tomcat's webapps dir.
      I went to "http://localhost:8080/struts-blank" and got the welcome message.
      All is well so far.

      Now I opened a DOS window, went to "<Tomcat-webapps-dir>/struts-blank/WEB-
      INF/src", and ran "ant all" (using ant 1.6.1). (I added a dummy Java
      interface class file in a dummy package to make the javadoc build target
      complete – it won't without any java files.) This generates a new .war file
      in "c:/projects/lib" called "blank.war". I took that .war file and dropped it
      into Tomcat's webapps dir.
      Then I went to "http://localhost:8080/blank" but now I got an error
      complaining about missing resources (welcome.title).

      After some searching, I found the problem. The "struts-config.xml" file that
      comes within the "struts-blank.war" of the struts 1.2.4 distribution has the
      following line:

      <message-resources parameter="MessageResources" />

      Indeed, in the "struts-blank.war" file, the resource file is
      called "MessageResources.properties", but in the "WEB-INF/classes/resources"
      directory, the file there is called "application.properties".

      Changing this line in "struts-blank.war" to:

      <message-resources parameter="resources.application" />

      and rebuilding the .war file and installing it again into Tomcat did the
      trick. The welcome message appears again.

      Expected behaviour is, of course, that a rebuild works (perhaps even without
      having any java files to javadoc) and produces a correct configured .war file
      that can be deployed and run successfully.

      Attachments

        Activity

          People

            Unassigned Unassigned
            megmond@randomwalk.com Maarten@RW
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: