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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:24:39+00:00 2026-06-11T09:24:39+00:00

In a link I have the { and } characters. In chrome/ff (and ie?),

  • 0

In a link I have the { and } characters. In chrome/ff (and ie?), when I click that link it replaces { with %7B and } with %7D. Unfortunately, in opera it doesn’t. If I URLEncoder.encode the link, then %7B becomes %257B in the other browsers (so then I get a 404 @ that resource). So when I click the link in opera I get java.lang.IllegalArgumentException: Illegal character in path at index. I’m confused about:

  1. Why doesn’t opera encode { and }?
  2. Why throw an exception? Why not just encode the URL and continue?
  3. How to solve this without breaking the links (w/extra encoding) in other browsers?

Edit: we’re using jersey, as it says in the stack trace:

java.lang.IllegalArgumentException: Illegal character in path at index
    java.net.URI.create(URI.java:859)
    javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:95)
    com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:879)
    com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:843)
    com.sun.jersey.spi.container.servlet.ServletContainer.doFilter(ServletContainer.java:804)
  • 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-11T09:24:40+00:00Added an answer on June 11, 2026 at 9:24 am

    Confusingly (i.e. it is badly named) URLEncoder is meant for passing data as parameters, not for encoding the URL itself.

    We use org.apache.commons.httpclient.util.URIUtil.encodePath but it looks like this has gone now (since 1.4?) and the suggestion is to use java.net.URI instead:
    What happened to URIUtil.encodePath from commons-httpclient-3.1?

    Have a look at this too: HTTP URL Address Encoding in Java

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

Sidebar

Related Questions

Lest say i have a link and when some one click on that link
I have link that calls a function when clicked: <a href=javascript:spawnMenu(this); id=link1>Test1</a> To make
I have a link which looks like that: www.domain.com/file.php I want to create .htaccess
I have some link resources with none latin characters like åäö These are usually
Problem: I need to confirm that iframe have one type of link with the
I have a link on my page, that when clicked calls a method with
I have a link that will consist on of 1 image and nothing else.
Imagine that I have a link button called readMore in the ItemTemplate of a
This is the link I have that contains a big list of data which
I have a 300MB file ( link ) with utf-8 characters in it. I

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.