Solved

I want to change the Title in servlet

Posted on 2012-03-13
3
250 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
Question by:stmani2005
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:stmani2005
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
allswap challenge 6 99
Where to store the queries for modification of table 4 62
couple of eclipse 5 37
Which non-HTML GUI front end to use with Java? 3 22
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

777 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