Avatar of Manikandan Thiagarajan
Manikandan Thiagarajan
Flag for India asked on

I want to change the Title in servlet

if (serviceOperation.getContentDisposition().equalsIgnoreCase("inline")) {
                                response.setHeader("Content-disposition","inline; filename=\"" + reportFileName    + "\"");
                            } else {
                                response.setHeader("Content-disposition","attachment; filename=\"" + reportFileName    + "\"");
                            }
                            response.setContentType(mimetype);
                            response.getOutputStream().write(Base64.decode(content));

How could I set the Browser Title in Above code

please help me
Java

Avatar of undefined
Last Comment
Kalpesh Chavan

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
chaitu chaitu

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Manikandan Thiagarajan

ASKER
Could you please specify the another way in servlet
Kalpesh Chavan

sorry you cant specify title in document other than html

if document is diffrent like pdf ,doc,xls then it is not possible

but if you want to show title then put your report servlet in iframe tag

example as follow

test.html


<html>
<head> <title>  Your Title </title>
<body>
 
 <iframe src='yourServletAddress'>
 
 </iframe>

</body>
</html>
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23