Solved

Getting the parameter value exactly the same in Java

Posted on 2007-04-04
5
213 Views
Last Modified: 2010-03-31
Hi All,

    I am passing querys as a  parameter in the url. But when I am getting that query back in another java class, I am having some problems like + is replaced with space and % is replaced with some special character etc. So my question is how should I get the query as it is without ant thing changed.

Thanks
MTREDDY
0
Comment
Question by:manyam537
  • 3
  • 2
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 18850680
Either use URLEncoder or URLDecoder
0
 

Author Comment

by:manyam537
ID: 18850839
Hi CEHZ,

     You mean I can use URLEncode.encode before sending it as an url parameter or after getting the parameter i have to use URLDecoder.decode. Is it right? What are the encodings or decodings I can use.

The method has encode(String parameter, String encodingUsed)

So what should I use for second parameter.

Thanks
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 18850856
That's right. I would use "UTF-8" for the second parameter to the method
0
 

Author Comment

by:manyam537
ID: 18850951
Hi CEHZ,

   Thanx for responding fast.

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18850959
:-)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now