Meaningless Drivel is fun!*
The moose likes Servlets and the fly likes response.setContentType() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "response.setContentType()" Watch "response.setContentType()" New topic
Author

response.setContentType()

Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
Hi,

I am having a String str


I am writing to response and fetching in Ajax call


Now the question is, I am getting String but some extra string is appending to it like


to responseObject, don't know why, even i removed
context.getResponse().setContentType("text/html;charset=UTF-8");

Please help me to solve this issue.

Thanks In Advance!!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

It has nothing at all to do with the content type. Somehow, that text is getting inserted by your code into the response buffer. Inspect your code to see why.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Aggarwal Arpit
Ranch Hand

Joined: Mar 04, 2012
Posts: 86
thanks Bear for reply, but it is the last line of my code, so how can code be instered in response buffer
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Without seeing any of your code, who can say?

Please post the relevant parts of the code, being sure to UseCodeTags.
 
Consider Paul's rocket mass heater.
 
subject: response.setContentType()
 
Similar Threads
Assign Jsp variable to Javascript variable
Conversion of special characters in a SOAP WebService Client
Need to perform an insert operation with AJAX
Reflection
Getting SOAPMessage as null