File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes server alias configuration with * character Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "server alias configuration with * character" Watch "server alias configuration with * character" New topic

server alias configuration with * character

unni venu

Joined: Oct 01, 2007
Posts: 1
I want to point to the same servlet application for all the requests coming to "" and any subdomain within "".
For e.g.: if I try to access "" or "" it should use the same application.

The problem is tomcat does not like wild cards in "Alias" tag in the "Host" section. I tried different alternatives but still the result is the same.

We are using JBoss 4.0.5 GA version which uses Tomcat 5.5.20 internally.

I can do this may be by using an Apache in the front by using URL rewrite. But I want to avoid that and be able to configure the JBoss server to directly accept such requests.

Any help is greatly appreciated.
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

I havent actually tried this. But, the Tomcat docs do mention that regular expressions are supported. They further mention that:

The syntax for regular expressions is different than that for 'standard' wildcard matching. Tomcat uses the java.util.regex package. Please consult the Java documentation for details of the expressions supported.

What is the regular expression that you tried? Maybe the regular expression that you mentioned was incorrect.

[My Blog] [JavaRanch Journal]
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

At this point, we are trying to figure out whether we can use wildcard support with the server configuration in Tomcat. Moving this post to our Tomcat forum, might get you better answers.
If at a later point, this turns into a JBoss specific question, the moderators are free to move this back here.

Good luck !
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: server alias configuration with * character
jQuery in Action, 3rd edition