aspose file tools
The moose likes Servlets and the fly likes response.setContentType() Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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: 56179
    
  13

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 56179
    
  13

Without seeing any of your code, who can say?

Please post the relevant parts of the code, being sure to UseCodeTags.
 
I agree. Here's the link: http://jrebel.com/download
 
subject: response.setContentType()
 
Similar Threads
Reflection
Assign Jsp variable to Javascript variable
Conversion of special characters in a SOAP WebService Client
Need to perform an insert operation with AJAX
Getting SOAPMessage as null