Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

EncoderTest

                         

This is a simple program of java network and supports the java.net package. Here, we have defined the class named EncoderTest.java. This class contains static methods for converting a String to the application-urlencoded MIME format.

The alphanumeric characters "a" through "z", "A" through "Z" and "0" through "9" remain the same. And the space characters ".", "-", "*", and "_" remain the same. The encoding string supports to the space character “ ” is converted into a plus sign “+”. All other characters are unsafe and are first converted into one or more bytes using some encoding scheme. 


Here is the code of this program:

import java.net.*;
import java.net.URLEncoder;

public class EncoderTest{
  public static void main(String[] args){
    System.out.println(URLEncoder.encode("This string has spaces"));
    System.out.println(URLEncoder.encode("This*string*has*stars"));
    System.out.println(URLEncoder.encode("This%string%has%percent%signs"));
    System.out.println(URLEncoder.encode("This.is.first.program.of.encoder"));
    System.out.println(URLEncoder.encode("This/is/simple/Encoder/test/program"));
  }
}


Output of this program:

C:\amar>javac EncoderTest.java

C:\amar>java EncoderTest
This+string+has+spaces
This*string*has*stars
This%25string%25has%25percent%25signs
This.is.first.program.of.encoder
This%2Fis%2Fsimple%2FEncoder%2Ftest%2Fprogram

C:\amar>

 

Download of this program.

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Latest Searches:
Š´??????Š´?????Å Â
web design
write number to binary
HibernateTemplate
The INSERT INTO Statem
logout ajax
programinjavatogetspee
videoplayerinjavaapple
freesturtsprojects
Jigloo SWT/Swing GUI B
Passing Parameters in
public
<t:tree2
struts 1.2 package lis
sending a mail through
configu.struts.xml
string handling
Flex 3
countthenumberofdigits
swing
mapping
SMS application
treetomahawk
drill down using jfree
jboss 4.0.2
javaappendtexttofile
program to explain the
mysql back up
HOWTO: Install Ruby on
Java 3D
getmonths
cocoon
logim.servlet program
create program
Login page source code
TreeGridusingflex
how to retrieve image
Java Swing Center a Di
dialogBox
jsp drop down menu
resize image
Photoshop Basics TV Sc
source code to send te
Visual Basic Networkin
dynamic insert value J
merg sort
LazyDynaBean
Quick Sort
drawarc canvas form
struts framework archi
how to arrange strings
struts FAQ's
throws
SMS in JAVA
populate RADIO BUTTON
source code to send te
MULTIPLE SELECT COMBO
checkbox in jsp html
java pdfs
Eclipse 3.4 EJB
listtovector
in photoshop how to ma
jframe
struts2radiobutton
à®°??à®°?யà¯?à®°???à
a simple calculator pr
iterator
duplicate string in ar
Jframe Tutorials
find the number of day
Photoshop Web Layouts
jquey
cancel button in Jsp
connection pooling wit
seam many to many
DBMS
mtab comany
simialaritytransformma
Agents
JProgressBar
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.