Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Case in-sensitive Jboss 7 web application context root

Tags:

jboss7.x

Is there a way to make web application context case in-sensitive?

Basically i'm doing the following in jboss-web.xml

<jboss-web>
    <context-root>cap</context-root>
</jboss-web>

I'm able to access the app via localhost:8080/cap, but trying to make it accessible via localhost:8080/Cap or localhost:8080/CAP. Any ideas please?

like image 599
Sudheer Palyam Avatar asked Sep 19 '11 12:09

Sudheer Palyam


People also ask

How do you find the context root of a web application?

The context root for an application is determined by how it is deployed. When a web application is deployed inside an EAR file, the context root is specified in the application. xml file of the EAR, using a context-root element inside of a web module.

What is context root in URL example?

By default, the context root is the server root itself, denoted as a single forward slash. Application root. Specifies the root of the application itself. The URL prefix is http://localhost:8080 and the context root is the application server root.

How do you set root context?

1.1 Right click on the project, select Properties , Web Project Settings , update the context root here. 1.2 Remove your web app from the server and add it back. The context root should be updated. 1.3 If step 2 is failing, delete the server, create a new server and add back the web app.


1 Answers

Put apache+mod_proxy in front of jboss and use url-rewriting or redirection (easier option). Example of rewrite:

RewriteEngine on
RewriteRule ^/Cap$ /cap/ [R]
RewriteRule ^/CAP$ /cap/ [R]

You would put the above to httpd.conf or a similar location.

like image 156
Tair Avatar answered Oct 06 '22 00:10

Tair