user1483313
user1483313

Reputation: 33

How to have Play 2.0 Framework ignore routes

Building a Play 2.0 scala app and deploying it to the ROOT context on Tomcat (from what I understand, a Play app must be deployed to ROOT context). There are other web apps running on this server at different contexts, but with the Play app at root, it is intercepting every request and failing if it is a route it does not understand.

Is there any way to have Play ignore a route in order to have Tomcat continue dispatching it to a servlet that is registered for that context?

thanks, brian

Upvotes: 2

Views: 452

Answers (2)

user1483313
user1483313

Reputation: 33

Actually, it turns out that this was not a problem after all. I had inadvertently not had the other apps deployed in the same tomcat server I was testing with (doh!). Once I deployed them properly, then the Play Framework app got the requests that were correctly bound for it and the other apps got the requests that were bound for them in the sub-contexts. So, false alarm.

Upvotes: 1

kheraud
kheraud

Reputation: 5288

In fact the limitation you have seams to be linked to sub-context deploiement. The play2 war plugin does not support it until Play 2.1

It could be possible to trick with tomcat conf to do what you want. I don't know tomcat enough to give you the right conf.

You can still deploy your Play app as a standalone app (not embedded in Tomcat) and use a front-end HTTP server to handle reverse-proxy to the right HTTP server. You will have to define for each HTTP server the right port to run on and then configure your reverse-proxy to route the request depending on the domain/port to the right local port. I use Nginx for that. Maybe Tomcat can handle this also.

Upvotes: 1

Related Questions