Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6723265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:32:55+00:00 2026-05-26T09:32:55+00:00

In Play Framework, I’ve noticed that it’s possible to separate configuration properties that are

  • 0

In Play Framework, I’ve noticed that it’s possible to separate configuration properties that are used in Dev or Prod mode.

The best in-use example is for baseUrl :

# Url-resolving in Jobs
# ~~~~~~
# When rendering templates with reverse-url-resoling (@@{..}) in Jobs (which do not have an inbound Http.Request),
# ie if sending a HtmlMail, Play need to know which url your users use when accessing your app.
# %test.application.baseUrl=http://localhost:9000/

%dev.application.baseUrl=http://127.0.0.1:9000
%prod.application.baseUrl=http://www.example.com

But I can’t make it work for another property:

%dev.application.staticUrl=/public
%prod.application.staticUrl=http://static.example.com

Calling Play.configuration.getProperty("application.staticUrl"), or even Play.configuration.getProperty("%dev.application.staticUrl") (to test) doesn’t make it :/

How can I make this work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:32:56+00:00Added an answer on May 26, 2026 at 9:32 am

    When running in dev mode you do not need to prefix your line with dev.

    I run my app in dev mode when developing the app and prod mode with 2 instances.
    Sample of my application.conf:

    
    application.mode=dev
    %inst1.application.mode=prod
    %inst2.application.mode=prod
    mail.smtp=mock
    %inst1.mail.smtp=MAILSERVER1
    %inst2.mail.smtp=MAILSERVER1
    

    Running the app with play run myapp will use the properties without prefix.
    In prod mode I run 2 instances with play start --%inst1 and play start --%inst2.

    This will create 2 instances of the app running with their own properties or the default one if not specified.

    When you use getProperty, never use the prefix i.e. Play.configuration.getProperty("mail.smtp") will return mock in dev mode or MAILSERVER1 in prod mode.

    In your case you have two configurations (not to be mistaken with running mode!), dev and prod. The application running mode is defined by application.mode property.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the in-memory database that comes with Play Framework, when I have db=mem
Is it possible to use the templating engine from the Play Framework in other
I am using the AVAudioPlayer framework, and I have several sounds that play one
I have a Play Framework application that sends emails using SMTP server. Now I
I am brand new to the Play framework, but I am trying to use
I found an old question How to use the Play framework to develop a
Am trying to use MSSQL server with Play Framework, In my application.conf db.url=jdbc:microsoft:sqlserver://localhost\SQL2008:1433;DatabaseName=testDB db.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
In play framework application.conf there are lines: %test.db.url=jdbc:h2:mem:play;MODE=MYSQL;LOCK_MODE=0 %test.jpa.ddl=create But I am using MongoDB
I have a small site I built using the Play framework that I'm trying
Using play framework 1.2.4 with scala. I have few play jobs that looks like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.