3 Replies Latest reply on Jun 4, 2012 11:40 AM by alllle

    Not able to set global mime-mapping

    alllle

      So according to the wiki page, the web subsystem configuration detail provided at http://docs.jboss.org/jbossweb/7.0.x/config/subsystem.html should be applicable to the JBoss AS 7. The page mentioned the mime-mapping setting that you can specify globally to add new types or overwrite default ones. However, I wasn't able to apply this to the JBoss AS server.

       

      According to the wiki, the "configuration" element can have multiple sub-element of mime-mapping. But in JBoss CLI, "mime-mappng" is not a valid child for the web configuration node. The valid ones are: container, jsp-configuration, and static-resources.

       

      I attemped to add a mime-mapping using the following CLI commmand and it failed:

      [standalone@localhost:9999 subsystem=web] /subsystem=web/configuration=mime-mapping:add(name=manifest,value="text/cache-
      manifest")
      Failed to get the list of the operation properties: "JBAS014739: No handler for read-operation-description at address [
          ("subsystem" => "web"),
          ("configuration" => "mime-mapping")
      ]"
      
        • 1. Re: Not able to set global mime-mapping
          alllle

          Also want to add that I understand you can add mime-mapping in the web.xml file of each application. But I'm looking for a global solution.

           

          Thanks!

          • 2. Re: Not able to set global mime-mapping
            ctomc

            hi,

             

            mime-mapping is complex field and not resource.

             

            that is why it has its own operation handlers add-mime/remove-mime to handle its value.

             

            what are you trying to achive can be done by command:

            /subsystem=web/configuration=container:add-mime(name=manifest,value="text/cache-manifest")

            Just bit of a warning when using this, there was a bug in 7.1.1 when you added mime type that prevented server to start.

            so please use 7.1.2 or 7.2 nightly builds where this is fixed.

             

            --

            tomaz

            • 3. Re: Not able to set global mime-mapping
              alllle

              The command worked which inserts the following line to the configuration file:

               

              <configuration>
              <mime-mapping name="manifest" value="text/cache-manifest"/>
              </configuration>

               

              And just as you mentioned, this prevents the server from startup. I'm using EAP v6 beta 2, apparently the fix is not included in this release.

               

              Thank you for the accurate reply.