Solved

I want to change the Title in servlet

Posted on 2012-03-13
3
241 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum6 challenge 6 76
JDeveloper 12c for 32 bit 4 68
recursion example 16 111
java stored proc example 9 21
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now