3 Replies Latest reply on Feb 9, 2012 9:48 AM by karin k

    How to configure settings for the whole JBoss and not only per deployment?

    mozo Newbie

      Hi everyone

       

      How can I configure setting from the web.xml and jboss-web.xml for all applications in the whole JBoss instead of configuring it for each application?

       

      For example I'd like to configure custom Authenticator Valves available for multiple applications.

       

      Now done in jboss-web.xml (per application)

      <jboss-web>

          <valve>

              <class-name>...</class-name>

          </valve>

      </jboss-web>

       

       

      Or in web.xml

      <login-config>

        <auth-method>CUSTOM</auth-method>

      </login-config>


      And in \modules\org\jboss\as\web\main\jbossweb-7.0.1.Final.jar\org\apache\catalina\startup\Authenticators.properties

      CUSTOM=...

      But for this it's necessary to modify a jar, which certainly isn't a good way.

       

       

      An other use case would be to add custom error pages once which then are valid for all web applications.

       

       

      Is there a global web.xml and jboss-web.xml or how can I configure this things?
      Or is it possible to configure such things in a profile under the web subsystem?

      Like it is possible for mime-mapping (http://docs.jboss.org/jbossweb/7.0.x/config/subsystem.html)

       

       

      Thanks in advance

        • 1. Re: How to configure settings for the whole JBoss and not only per deployment?
          u j Novice

          Hi,

          have you found any solution?

           

          I have a related question, how can I customize the error page 404 of AS 7?

          Not in the application web.xml, but for the whole AS.

          When an application is down for maintenance, JBoss (Web) shows a standard 404 page, I would like to change it to something

          nice like "We are on maintencance ..."

           

          Thanks

          • 2. Re: How to configure settings for the whole JBoss and not only per deployment?
            Remy Maucherat Novice

            To summarize quickly, freeform global settings are not going to be provided, since that doesn't quite fit in the very strict configuration style of the domain model. Some of this can be configured using your own deployers, like how JSF is integrated (it adds its metadata, like filters, to the web deployment metadata).

             

            The global error page is a probelm that could be worked around using a well designed root webapp normally. Similarly, global valves are not customizable (which is why there are hardcoded elements for the functionality like <sso>, <rewrite>, etc). This was designed like that on purpose, they didn't want the old server.xml basically, but obviously some of the hacking capabilities are gone.

             

            Hopefully, that sheds some light on why things are the way they are.

            • 3. Re: How to configure settings for the whole JBoss and not only per deployment?
              karin k Newbie

              Hi Remy

              thanks for your answer.

               

              I have some questions to verify if I understood you correctly

              Remy Maucherat schrieb:

               

              To summarize quickly, freeform global settings are not going to be provided, since that doesn't quite fit in the very strict configuration style of the domain model. Some of this can be configured using your own deployers, like how JSF is integrated (it adds its metadata, like filters, to the web deployment metadata).

               

              Can you pls. give me a hint what this concretely would imply

              Are the steps below correct?

              1. I write my own MyOwnDeploymentProcesser, which inherits from org.jboss.as.server.deployment.DeploymentUnitProcessor and sets e.g. my global servlet filters.
              2. I write my own Extension using Guide  https://docs.jboss.org/author/display/AS71/Example+subsystem
              3. In my own Extension I will use the performBoottime to initialize the Deployer (MyOwnDeploymentProcessor)

              ...

               

              Would that be the way you have recommended above?

              Thanks for your help