?
Solved

how do i use URLEncoder in Java 1.3 for a Solaris server?

Posted on 2009-02-09
6
Medium Priority
?
496 Views
Last Modified: 2013-11-21
I have the following in my jsp:
String descURL = URLEncoder.encode(desc, "UTF-8");

It works for Java 1.5 in a Linux server.  I need to make it also work in a Solaris server using Java 1.3.

What is the equivalent?

Error message:
java.net.URLEncoder cannot be applied to (java.lang.String,java.lang.String)
probably occurred due to an error in /jsp/sites.jsp line 100:
String descURL = URLEncoder.encode(desc, "UTF-8");
0
Comment
Question by:galaxy573
  • 3
  • 2
6 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 23594730
Would have to be
String descURL = URLEncoder.encode(desc);

Open in new window

0
 
LVL 92

Assisted Solution

by:objects
objects earned 500 total points
ID: 23594754
there was no charset then, so remove last parama

String descURL = URLEncoder.encode(desc);

The javadoc is always a good place to check as it will tell you when methods werew added

0
 

Author Comment

by:galaxy573
ID: 23603842
will String descURL = URLEncoder.encode(desc); also work in Java 1.5?  

I need to take my code and make it compatible in Java 1.3 & 1.5 & it'd be easier for me if i can find a solution that will work in both versions.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 86

Expert Comment

by:CEHJ
ID: 23603860
>>also work in Java 1.5?

Yes, but it will be marked as deprecated
0
 
LVL 92

Expert Comment

by:objects
ID: 23606678
> will String descURL = URLEncoder.encode(desc); also work in Java 1.5?  

if you want it to be compatible with both then you must use that method

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 23719389
:-)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

As a financial services provider, your business is impacted by two of the strictest federal regulations on record: the Sarbanes-Oxley Act and the Gramm-Leach-Bliley Act. Correctly implementing faxing into your organization to provide secure, real-ti…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Suggested Courses
Course of the Month13 days, 15 hours left to enroll

809 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