How to use "war.context" in a Play Framework configuration file?

How to use "war.context" in the Play Framework configuration file?

+2
source share
1 answer

See this topic in Google Groups for a description of what you are asking.

http://groups.google.com/group/play-framework/browse_thread/thread/b4783c821fd29898?pli=1

In essence, what he says is.

In your application.conf file, you set a property like

war.context=/MyAppName 

Then, in the routes file, you set it to include your WAR context as follows.

 # Set context name %{ ctx = play.configuration.getProperty('war.context', '') }% # Routes # This file defines all application routes (Higher priority routes first) # ~~~~ # Home page GET ${ctx}/ Application.index # Map static resources from the /app/public folder to the /public path GET ${ctx}/public/ staticDir:public # Catch all * ${ctx}/{controller}/{action} {controller}.{action} 

Thus, you can see that no matter what you place in your war.context, you can put in your routes to choose the right path.

+4
source

Source: https://habr.com/ru/post/905069/


All Articles