Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem sending a string as Http response

 
harsha galla
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have a problem where i tried to send the string form of xml data as a response to the front end which makes a http call to the servlet. But my front end recieves response as java.lang.NullPointerException.

Can anybody tell why this is happening.
I send string to front end with the following command:

where xx is the string of xml i.e "xml data....."
which means xx has been converted to string data.
but when i send some string like "blah,,,blah..."

it is recieved correctly as "blah..blah" in the front end.
Is this issue because of xml data present as string..
Any help is welcome

Thanks in advance

[ November 20, 2008: Message edited by: harsha galla ]
[ November 20, 2008: Message edited by: harsha galla ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go to your server's logs and find out what line of code is throwing the NullPointerException (NPE).

If that doesn't make it clear what you need to do, post the relevant section of code, along with something that lets us know which line is throwing the NPE and we might be able to help you.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am guessing that in the line:

pw.print(xx);

xx is in fact a null reference. How are you checking that it is not?

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic