How to specify multiple contexts for a web application in JBoss EAP?

Solution Verified - Updated -

Environment

  • JBoss Enterprise Application Platform (EAP)

    • 5.0

    • 4.3

    • 4.2

  • JBoss Service Oriented Architecture (SOA)

    • 5.0

    • 4.3

    • 4.2

Issue

  • How to deploy Josso on muliple context, so the application could be reach with both urls such as:

https://josso.jboss.com:8443/josso
https://josso.jboss.com:8443/sso

Resolution

Enable and use a rewrite rule as covered in How do I enable and use the rewrite valve in JBoss?

  • If servlet, multiple mappings in web.xml
  • Create a sso.war and redirect to josso
  • Add RewriteValve in JBossWeb and a rule
    • Edit $JBOSS_HOME/server/$JBOSS_CONFIG/deploy/jboss-web.deployer/server.xml
    • Add this under the <Engine...> tag:
      • <Valve className="org.jboss.web.rewrite.RewriteValve" />
    • Create the rewrite.properties in this location: $JBOSS_HOME/server/$JBOSS_CONFIG/conf/jboss.web/rewrite.properties
      • RewriteRule  ^/sso$ /josso/ [PT]

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments