Hi Sridhar,
Try the following code. All I really did was use the printwriter and it seemed to be working. Let me know if this works for you.
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.net.URLDecoder;
import java.net.URLEncoder;
public class trish extends HttpServlet {
private static final String CONTENT_TYPE = "text/html";
String str=null;
String temp1=null;
String ret=null,temp=null;
/**Initialize global variables*/
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
/**Process the HTTP Get request*/
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType(CONTENT_TYPE);
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>Servlet1</title></head>");
out.println("<body>");
out.println("<p>The
servlet has received a GET. This is the reply.</p>");
out.println("</body></html>");
try{
ret=URLEncoder.encode("srikanth|sridhar|madhu|rachu|paddu|");
out.println(ret);
}catch(Exception e){
System.err.println(e.getMessage());
}
try{
temp=URLDecoder.decode(ret);
out.println(temp);
}catch(Exception e){
System.err.println(e.getMessage());
}
}
}
Trish