Solved

Getting the parameter value exactly the same in Java

Posted on 2007-04-04
5
223 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

724 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