The Artima Developer Community
Sponsored Link

Java Answers Forum
how can i set the window title when using response.setContentType

1 reply on 1 page. Most recent reply: Jun 2, 2004 11:34 PM by mausam

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Ankur Mittal

Posts: 2
Nickname: csmits
Registered: Jun, 2004

how can i set the window title when using response.setContentType Posted: Jun 2, 2004 11:26 PM
Reply to this message Reply
Advertisement
My sample code is

</html>
<head>
<title>Deal Edge</title>
</head>
<body>
<%
response.setContentType("application/msword") ;
%>

I use this generate a word file through JSP.
But the problem is that I cannot change the title of window when I use this. Instead the window title becomes complete URL. like - http://localhost:7001/ShowFile?id=1

Even javaScript is not working.
It works fine when i remove the set content tag.

So Please tell me how can I set the title of window


mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: how can i set the window title when using response.setContentType Posted: Jun 2, 2004 11:34 PM
Reply to this message Reply
Does this help?

PrintWriter out = response.getWriter();
...
..
//other codes
out.println("<title>" + title + "</title>");

//

Flat View: This topic has 1 reply on 1 page
Topic: help on interfacing java with crystal report Previous Topic   Next Topic Topic: Writting to a text pad file...

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use