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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:03:40+00:00 2026-06-05T08:03:40+00:00

I want to encode part of URL paramter in JAVA http://statebuild-dev.com/iit-title/size.xml?id=(102T OR 140T) to

  • 0

I want to encode part of URL paramter in JAVA

http://statebuild-dev.com/iit-title/size.xml?id=(102T OR 140T)

to

http://statebuild-dev.com/iit-title/size.xml?id=(102%20OR%20140)

have tried using URI to encode but it also encodes ? which I do not want. In the URL I want to encode the part after ‘=’

URI uri = new URI("http", 
    "statebuild-dev.com/iit-title", "/size.xml?id=(102 OR 140)", null);
//URL url = uri.toURL();
System.out.println(uri.toString());
System.out.println(url1);

Thank You

  • 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-06-05T08:03:42+00:00Added an answer on June 5, 2026 at 8:03 am

    This answer has a good discussion of encoding the various parts of a URI/URL. You’re on the right track, but your specific problem is that you have the various parts of the URI wrong. You need to use the multi-part constructor that takes an authority, path, query, and fragment:

    URI uri = new URI("http", "statebuild-dev.com", "/iit-title/size.xml", "id=(102 or 104)", null);
    System.out.println(uri.toString());
    System.out.println(uri.toASCIIString());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If the following string is what I want to url-encode, @test123: http://news.yahoo.com/fifa%E6%96%A5%E8%B3%87%E5%8D%83%E8%90%AC-%E5%8A%A9%E6%88%91%E8%B6%B3%E7%90%83%E5%8D%87%E7%B4%9A-185314701.html check out
In my java app I'm preventing XSS attacks. I want to encode URL and
As the title mentioned, I want to encode a Image Obj into some kind
I want something to turn ?a=5&b=8 part of a URL into a dictionary {
I need to encode a Java String to display properly as part of an
I am working on creating a simple HTTP server as part of a Java
I want to encode DNS protocol header using C and create a UDP datagram.
I want to encode and decode Bitmap object in string base64 . I use
I want to encode binary file into base64 and put it into php page
I want to do encode the data before saving it to a database table

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.