Solved

I want to change the Title in servlet

Posted on 2012-03-13
3
273 Views
Last Modified: 2012-03-25
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
0
Comment
3 Comments
 
LVL 20

Accepted Solution

by:
chaitu chaitu earned 500 total points
ID: 37718631
http://stackoverflow.com/questions/1058959/how-to-change-the-title-of-a-browser-page-which-a-servlet-streamed-a-pdf-to

using javascript it will be more easy;

document.title = "This is the new page title.";
0
 
LVL 8

Author Comment

by:Manikandan Thiagarajan
ID: 37718729
Could you please specify the another way in servlet
0
 
LVL 3

Expert Comment

by:kalpeshchavan
ID: 37719112
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>
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MySQL  on Tomcat 8 71
difference between sorce folder and folder in eclipise 3 29
Java syntax, or is it Selenium 6 30
restrict decimal places for double datatype 10 22
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question