Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Getting the parameter value exactly the same in Java

Posted on 2007-04-04
5
Medium Priority
?
226 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
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 tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

610 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