1

Users currently connect to the app on URLs such as:

http://myServer01/crr/
http://example.com/crr/

We'd like to simplify this to:

http://myServer01/
http://example.com/

with out my app name can some one help me on this.

1

The docs appear to suggest a mod_rewrite (Apache) syntax is used:

The rewrite valve implements URL rewrite functionnality in a way that is very similar to mod_rewrite from Apache HTTP Server.

The rewrite valve can be configured as a valve added in a virtual-host. See virtual-server documentation for informations how to configure it.

It can also be in the jboss-web.xml of a webapp configured as a normal value:

<valve>
    <class-name>org.jboss.web.rewrite.RewriteValve"</class-name>
</valve>

The valve will then use a rewrite.properties file containing the rewrite directives, it must be placed in the WEB-INF folder of the web application

So, in rewrite.properties you would have something like this (assuming "crr" is your app name):

RewriteRule !^/?crr/ /crr%{REQUEST_URI} [L]

If it's like Apache then you would also need a RewriteEngine On directive preceding this, however, I see no mention of this in the docs.

Reference:


Instead of changing Jboss-web.xml and adding property file, Is there any chance that i can do changes in standalone.xml ???

Yes, depending on JBoss version it does appear to be possible to put everything in standalone.xml instead, with a change of syntax.

Try the following, inside the <virtual-server> container:

<rewrite pattern="!^/crr/(.*)" substitution="/crr/$1" flags="L"/>

Reference:

  • Instead of changing Jboss-web.xml and adding property file, Is there any chance that i can do changes in standalone.xml ??? – user97496 Jan 17 at 14:29
  • Yes, that does appear to be possible. I've updated my answer. – MrWhite Jan 17 at 17:08

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.