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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:19:48+00:00 2026-05-28T02:19:48+00:00

I need an absolute URL on my Play! 1.2.4 application as a callback for

  • 0

I need an absolute URL on my Play! 1.2.4 application as a callback for an OAuth authentication (using Scribe.

My application is running behind an Apache virtual proxy, to be accessible through an URL with subdomain like “http://myapp.mydomain.com”, proxying “http://127.0.0.1:9000”. ProxyPreserveHost is set to On. In my Play! application configuration, I have the following property : application.baseUrl=http://myapp.mydomain.com/.

To compute this absolute URL, I used a piece of code like :

Router.ActionDefinition ad = Router.reverse("Controller.callback");
ad.absolute();
return ad.url;

This code worked fine with Play! 1.2.3 : it returned “http://myapp.mydomain.com/callback”.

Now that I use Play! 1.2.4, this code now returns “http://www.mydomain.com:9000/callback” (translated URL by the virtual proxy without subdomain), as if Play! now used HTTP request’s URL to build this absolute URL.

I empirically replaced this code to Router.getFullUrl("Controller.callback"), which fixes my issue.

Those two methods Router.getFullUrl() and Router.absolute() are not documented (booo!), and I was wondering the subtle differences to understand my issue.
I suppose that Router.absolute() uses current HTTP request to build absolute URL, and Router.getFullUrl() uses application.baseUrl configuration property.
I also may have an Apache configuration issue (as it is clearly not one of my skills!), but with ProxyPreserveHost set to On, I assumed that my virtual proxy would be transparent to Play! application, and I don’t understand why it appears when switching from Play! 1.2.3 to 1.2.4.

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-28T02:19:49+00:00Added an answer on May 28, 2026 at 2:19 am

    You got me curious so I went looking into the code (click to see the relevant functions directly in github). And I agree that Play! documentation is far from complete :), actually code would benefit of some more javadocs!

    Some more tests

    In any case, this might be a bug… or a misuse!, there’s a couple of tests you should do:

    One thing you should try is the template absolute notation: @@{…}. Most of the time you do not need to reverse urls in your code, just in templates. Is that correct or not?

    Did you try Router.reverse("action", true) ?

    And what happens if you access directly the “localhost:9000” url from your browser, with all the different ‘absolute’ options?

    The code

    In the 1.2.4 code:

    String getFullUrl(...) is simply equal to getBaseUrl() + actionDefinition=reverse(...)

    and
    String getBaseUrl() is defined as application.baseUrl ONLY IF there’s no request – otherwise it uses Http.Request.current().getBase().

    ActionDefinition.absolute uses a bunch of variables from the reverse result.

    In 1.2.3 code:

    reverse

    absolute

    The @@ tag basically uses:

    private String __reverseWithCheck(String action, boolean absolute) {
        return Router.reverseWithCheck(action, Play.getVirtualFile(action), absolute);
    }
    

    with absolute true, that is calling directly reverse(action, absolute=true) but receiving a string rather than an ActionDefinition

    Conclusions

    Maybe some play developer will step in… but i tried to help a bit, and learn in the process 🙂 I’ll let you step into the full details of comparing the two functions, but they have quite a different approach in deliverying an abs. url…

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

Sidebar

Related Questions

I need to process CSS files to make any relative paths (using url()) absolute.
I'm using URL Rewrite and Application Request Routing in IIS 7.5 to set up
Is there any way to get pyramid absolute application url in main() function? I
My login redirect is being built with an absolute url but I need to
I need to generate an absolute URL that will use the secure HTTP protocol
I have a relative or absolute url in a string. I first need to
I need to get the absolute value of an NSDecimalNumber without loss of precision.
I need something like this http://jonraasch.com/blog/a-simple-jquery-slideshow but w/o the absolute positioning. Is it possible?
In a javascript file (e.g. script.js) I need a variable that contains the absolute
need ask you about some help. I have web app running in Net 2.0.

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.