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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:08:54+00:00 2026-05-27T03:08:54+00:00

This is an absolute URI of the server: URI base = new URI(http://localhost/root?a=1); This

  • 0

This is an absolute URI of the server:

URI base = new URI("http://localhost/root?a=1");

This is a relative URI:

URI rel = new URI("/child?b=5");

Now I’m trying to apply relative one to the absolute and receive:

URI combined = base + rel; // somehow
assert combined.equals(new URI("http://localhost/root/child?a=1&b=5"));

Is it possible to do such a manipulation with JDK or some library?

  • 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-27T03:08:55+00:00Added an answer on May 27, 2026 at 3:08 am
    URL mergedURL = new URL(new URL(baseUrl), relativeUrl);
    

    To pass on base url’s parameters to merged url, you’ll have to extract them manually by calling URL#getQuery and append them to new URL

    Something like,

    String finalUrl = mergedUrl.toString() + "&" + baseUrl.getQuery();
    

    It will take an if() to decide whether an ‘&’ is required to join them depending on what mergedUrl looks like.

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

Sidebar

Related Questions

I use: Dim bmi As New BitmapImage(New Uri(fiInfo.FullName, UriKind.Absolute)) bmi.CacheOption = BitmapCacheOption.OnLoad this does
I have a base URL : http://my.server.com/folder/directory/sample And a relative one : ../../other/path How
I need something like this http://jonraasch.com/blog/a-simple-jquery-slideshow but w/o the absolute positioning. Is it possible?
This is my JSP page's taglib directive: <%@ taglib uri=http://java.sun.com/jsp/jstl/core prefix=c %> I'm getting
I've a JSP with <%@taglib uri=http://java.sun.com/jsf/facelets prefix=ui %> However it errors with The absolute
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar
Okay I've been trying to figure this out for a while now. I have
This should be simple. I want to get an absolute Uri given the controller,
I have a relative URI: Uri U = new Uri(../Services/Authenticated/VariationsService.svc, UriKind.Relative); The problem is
I'm trying to send a POST request to a PHP script (http://mywebsite/index/test/ in this

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.