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 6723355
In Process

The Archive Base Latest Questions

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

Using Play Framework, I was wondering if it was possible to load some vars

  • 0

Using Play Framework, I was wondering if it was possible to load some vars in the template like I do in other controllers.

I mainly think about my “STATIC_URL” var that contains the path to the static files, that changes between my DEV/PROD modes.

Or at least, which alternatives I can use to make this works?

Thanks for your help!

  • 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:33:33+00:00Added an answer on May 26, 2026 at 9:33 am

    Your question is not very clear and could do with an example of what you are trying to achieve.
    However if what I think you are asking is correct try the following in your controller:

    //This will run before any controler request is called
    @Before
    static void globals() {
        renderArgs.put("staticUrl", staticUrl);//Adds staticUrl object to the renderArgs map.
    }
    

    Then in your template use ${staticUrl} to access the value from the renderArgs map.

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

Sidebar

Related Questions

I am using Play Framework about 1 month and it is a great thing,
Using play framework 1.2.4 with scala. I have few play jobs that looks like
I am using the following template tag in the Play framework to create an
I'm using the Play Framework and have a question about templates: I want to
Writing a Java application using the Play framework and need some HTTP-Live streaming. I
Using Play Framework, you can do something like this: public static void mymethod() {
I'm using Play framework. I have a JSONObject which has a structure like the
I'm using Play Framework and I have what I think is a very frequent
Let's say I have a Student entity like this implemented using the Play Framework's
iam using AVFoundation Framework to play mp3 file ,everything works great ، i have

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.