res.setContentType("text.html");
// This means that the content type which you would like to publish is either text or html..
Type - should be text/html, and it is a registered content type. It does not mean 'text or html' it means 'the response is text, html specifically' as opposed to 'text/plain', 'text/xml' etc.
s.o.p.ln(str);
>> this will give the o/p in the browser YXZ but in bold, it will not display as txt untile unless you read it out from a file of txt extension. I'm assuming s.o.p is System.out.println (s.r.k, please don't abbreviate like this, it causes confusion), and this is incorrect. You want to get an output to the client via either response.getOutput() or reponse.getWriter(). Getting a Writer is easire since you are returning text.
But this kinda thing is not even possible in mail servers as well... I think we're getting off topic here. Mail has not been mentioned till this point.
My take on the questions was that given a string you wanted to display it as plain text and as bold text, but as a single response.
A response can have only one content-type, so you would set the content type as 'text/html' since this satisfies both, then add the HTML 'mark up' to print the text in bold.
Then again I might be completely off track too.
Dave