1

Below is the process followed.

I pass receiver name and html path via form submit. I append that parameter to the url and that paramter will dynamically added in html content.

I m able to see that special character passed appears correctly in my servlet.

but after i read the html content and display the content again, the special character is ecsaped. But the same character included in static content appears correctly when displayed. Below is the snippet used.

url = new URL(emailPagePath);

URI uri = new URI(url.getProtocol(), url.getUserInfo(), url.getHost(), url.getPort(), url.getPath(),url.getQuery(), url.getRef());          

url = uri.toURL();

URLConnection conn = url.openConnection(); 

Reader reader = new InputStreamReader(conn.getInputStream(),ApplicationConstants.ISO_CHAR_SET);

BufferedReader br = new BufferedReader(reader);

String inputLine;

StringBuilder content = new StringBuilder();

while ((inputLine =br.readLine()) != null) {

content.append(inputLine);

}
TobiasR.
  • 826
  • 9
  • 19
Sagar
  • 35
  • 5

1 Answers1

0

I'm not sure what you mean by "special character is escaped" but that hints at an incorrect Charset value in the InputStreamReader constructor.

These previous answers provide more info about this:

Community
  • 1
  • 1
Bertrand Delacretaz
  • 6,100
  • 19
  • 24