How to put HTML content after the following java code in the JSP

Hello Guys :),
In the following jsp I force the user to download a file but I am not able to perform any action after I do this. I want to put some HTML code in this jsp at the end so that user has the option of doing other things after downloading the file.
Any solution will be highly appreciated :)
Thanks
<%@ page import="java.util.*,java.io.*"%>
<script language="JavaScript" src="common.js"></script>
<%
Hashtable hashTable = (Hashtable)session.getAttribute("platformAndSampleInfo");
Date date = (Date)hashTable.get("date");
String userName = (String)hashTable.get("userName");
String dateString = date.toString().substring(0, date.toString().length()-9).replace(' ','_');
dateString = dateString.replace(':','_');
String fileExtension = (String)session.getAttribute("fileExtension"); //,getFileExtension(request));
String outputFile = userName + dateString + fileExtension;
     File f = new File (outputFile);
     response.setContentType("APPLICATION/OCTET-STREAM");
     response.setHeader ("Content-Disposition", "attachment; filename=\""+ f.getName() + "\"");
InputStream in = new FileInputStream(f);
     ServletOutputStream outs = response.getOutputStream();
          int bit = 256;
          int i = 0;
          try {
               while ((bit) >= 0) {
                    bit = in.read();
                    outs.write(bit);
          } catch (IOException ioe) {
               ioe.printStackTrace(System.out);
          outs.flush();
          outs.close();
          in.close();     
%>
<!--
The following piece of HTML code is never reached
-->
<html>
Want to display this
<html>

Thats odd.. try using out to print the character
inst of creating the instance outs.. Maybe your
overiding something.
ex)
char c='s';
out.print(c);
//the jsp will create the instance of out for you.

Similar Messages

  • Zenwsreg returned the following error code: 404

    L.S.
    I'm having problems importing workstations. I've already configured a
    number of networks, and only on this one I'm having problems.
    The problem in short:
    Workstations don't get imported. On the prompt I get:
    Zenwsreg returned the following error code: 404
    The problem more elaborate:
    The network:
    Netware 6.0 SP5
    Zfd 4.01 SP6
    Workstation
    XP
    Tree:
    I would like to import workstations is a separate container.
    I made a server policy package, in Policies, Netware I defined a
    workstation import policy, In this policy I put containers and in
    platform, and in platform general I put allow importing, selected
    container, one of the containers I defined earlier.
    Still I get:
    Error on the XP-DOS prompt:
    Zenwsreg returned the following error code: 404
    Then I put logging on. I got this error line:
    Error line in
    Leaving HTTPUtil::SendMessage, returning 404
    Any help?
    Thanks
    (There is no one at [email protected])
    Complete zenwsreg.log:
    Friday, December 02, 2005 10:29:25 -- -- Entering ZENWSREGRegister
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    ZenLiteTree::ZenLiteTree()
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    ZenLiteTree::ZenLiteTree()
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    ZenLiteTree::InitZENContextIfNeeded
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- About to call
    ZENContextInit(ptr, REMADM)
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    ZENContextInit
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Returned from
    ZENContextInit(<REMADM><2><switact.rsg1><0>, REMADM, 1)
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Leaving
    ZenLiteTree::InitZENContextIfNeeded, returning 1
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    ZenLiteTree::ZenLiteTree(zenContext)
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Leaving
    ZenLiteTree::ZenLiteTree(zenContext)
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    NDSTree::WhoAmI()
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- WhoAmI()
    returning switact.rsg1.
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Leaving
    NDSTree::WhoAmI()
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    NDSTree::GetTreeName()
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister --
    NDSTree::GetTreeName() returning REMADM.
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    NDSTree::GetTreeName()
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    Registrar::Register
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Created
    Mutex.
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Got Mutex.
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    Registrar::Update
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Leaving
    Registrar::Update, returning 1
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    Registrar::Import
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    GenerateImportDoc
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- User Tree =
    <REMADM>
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- User DN =
    <switact.rsg1>
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Login count =
    <1>
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    ZenLiteTree::ZenLiteTree()
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    ZenLiteTree::ZenLiteTree()
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- ConnType = 2
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Encountered
    Winsock error 4294967295 when trying to scan the IPX address.
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    ZenLiteTree::ZenLiteTree()
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    ZenLiteTree::ZenLiteTree()
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- ConnType = 2
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Leaving
    GenerateImportDoc
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Entering
    HTTPUtil::SendMessage
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- HTTP server =
    zenwsimport
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Loaded
    wininet.dll
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- About to
    create an HTTP connection.
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Connecting to
    server <zenwsimport> port 8039.
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- hConnect =
    13369352
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- hRequest =
    13369356
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- Finished
    opening request. hRequest = cc000c.
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- About to send
    the following request:
    Friday, December 02, 2005 10:29:25 -- ZENWSREGRegister -- <?xml
    version="1.0" encoding="UTF-16LE"?>
    <new_ws>
    <computer>DAVINCI-A750EDC</computer>
    <cpu>PENTIUM 4</cpu>
    <dns>davinci-a750edc.adm.noa.davinci.local</dns>
    <subnet_mask>255.255.255.0</subnet_mask>
    <ip>192.168.30.41</ip>
    <ipx></ipx>
    <mac>00:13:20:83:25:66</mac>
    <os>WINXP (5.1 Service Pack 2)</os>
    <server>FS_NOA_ADM1</server>
    <user_tree>REMADM</user_tree>
    <user_dn>switact.rsg1</user_dn>
    <login_count>1</login_count>
    <auditing_version>4.0.1.53</auditing_version>
    </new_ws>
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- Last error =
    12029
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- Error: Kan
    geen verbinding maken met de server
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- Leaving
    HTTPUtil::SendMessage, returning 12029
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- Entering
    HTTPUtil::SendMessage
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- HTTP server =
    zfd_mts
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- Loaded
    novinet.dll
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- About to
    create an HTTP connection.
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister --
    InternetSetOption returned 1
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- Connecting to
    server <zfd_mts> port 80.
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- hConnect =
    33619969
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- hRequest =
    50397185
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- Finished
    opening request. hRequest = 3010001.
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- About to send
    the following request:
    Friday, December 02, 2005 10:29:26 -- ZENWSREGRegister -- <?xml
    version="1.0" encoding="UTF-16LE"?>
    <new_ws>
    <computer>DAVINCI-A750EDC</computer>
    <cpu>PENTIUM 4</cpu>
    <dns>davinci-a750edc.adm.noa.davinci.local</dns>
    <subnet_mask>255.255.255.0</subnet_mask>
    <ip>192.168.30.41</ip>
    <ipx></ipx>
    <mac>00:13:20:83:25:66</mac>
    <os>WINXP (5.1 Service Pack 2)</os>
    <server>FS_NOA_ADM1</server>
    <user_tree>REMADM</user_tree>
    <user_dn>switact.rsg1</user_dn>
    <login_count>1</login_count>
    <auditing_version>4.0.1.53</auditing_version>
    </new_ws>
    Friday, December 02, 2005 10:29:27 -- ZENWSREGRegister -- Finished
    sending request. Result = 1
    Friday, December 02, 2005 10:29:27 -- ZENWSREGRegister -- Leaving
    HTTPUtil::SendMessage, returning 404
    Friday, December 02, 2005 10:29:27 -- ZENWSREGRegister -- Entering
    Registrar::Import
    Friday, December 02, 2005 10:29:27 -- ZENWSREGRegister -- Import
    failed. Error: 404
    Friday, December 02, 2005 10:29:27 -- ZENWSREGRegister -- Released
    Mutex.
    Friday, December 02, 2005 10:29:27 -- ZENWSREGRegister -- Leaving
    Registrar::Register, returning 404
    Friday, December 02, 2005 10:29:27 -- ZENWSREGRegister -- Leaving
    ZENWSREGRegister, returning 404

    L.S.
    Thanks. Problem solved. For who wants to know, read on
    > ok... the zenwsimport dns is not resolved..
    Aargh! This is "by design" in my workstation deployment strategie .....
    but only up to some point. I was forced to troubleshoot a not very well
    deployed image (when will people read my instructions).
    The workstation at this state had a line in the hosts file to prevent
    registring the workstation. This should be deleted in the final state
    of the workstation but hadn't.
    >
    > that's why he is going for the middletier server..
    >
    > from where the 404 is comming from..
    >
    Well, i'll read that one as soon as I need this.
    > troubleshooting Middle Tier authentication
    > http://support.novell.com/cgi-bin/se...?/10073537.htm
    > --
    >
    Thomas Roes
    there is no one at [email protected]
    www dot switact dot nl (not yet a very mature site)

  • How to get the java code of the message mapping

    how to get the java code of the message mapping,
    I mean to ask how to get the background java code of the message mapping(graphical mapping).
    And where to view it?

    Hi Satya,
    The JAVA code for graphical msg mapping is in below folder:
    \usr\sap\<SID>\<DVEBMGS10>\j2ee\cluster\server0\temp\classpath_resolver
    Here all the mapping jars are there in this folder.
    Just decompile these jars and you can see the code.
    Thanks,
    Rajeev Gupta
    Message was edited by:
            RAJEEV GUPTA

  • How to view the java code of the message mapping,

    Hi Experts,
    <b>how to view the java code of the message mapping,</b>
    how to get the background java code of the message mapping(graphical mapping).
    And where to view it?

    Hi sowmya,
    Open any  Message mapping in IR. Press <b>CtrlShift0(zero)</b> to open a new menu.
    There you will find an option "Is Java Source Code Available?"
    There will be an export button nearby. Use it to get the code.
    Open it in a zip , you will see the hide java code.
    The JAVA code for graphical msg mapping is in below folder:
    \usr\sap\<SID>\<DVEBMGS10>\j2ee\cluster\server0\temp\classpath_resolver
    Here all the mapping jars are there in this folder.
    Just decompile these jars and you can see the code.

  • How to put html file into a canevas?

    How to put html file into a canevas?

    Hi,
    would require you to write a JavaBean that interprets the HTML (there are commercial versions of this available)
    Frank

  • Hi, on the link below, I need to open the "demande de visa de resident temporaire" but once I click on it it gives me the following message: " To view the full contents of this document, you need a later version of the PDF viewer. You can upgrade  to the

    hi, on the link below, I need to open the "demande de visa de resident temporaire" but once I click on it it gives me the following message: " To view the full contents of this document, you need a later version of the PDF viewer. You can upgrade  to the latest version of Adobe Reader from www.adobe.com/products/acrobat/readstep2.html  For further support, go to www.adobe.com/support/products/acrreader.html".
    the link is: http://www.cic.gc.ca/francais/information/demandes/visa.asp?countrySelect=RO#applications
    can someone please help me? I've tried installing everything as per the indication in the message but I still get that error message.

    update your adobe reader here, http://get.adobe.com/reader/
    untick unwanted tag-along ware.

  • How to insert HTML content in a IVIEW

    Hi,
    How to insert HTML content in a iview any body help me with the solution.
    Thanks & Regards
       kiran.B

    Hi,
    You can just spit out HTML in the request object:
    request.write("<B>Whatever</B>");
    Or if you have a single HTML page, you might want to just add it to KM and create an iView from it.
    Hope this helps.
    Daniel

  • How to print HTML contents

    can anyone tell me how to print HTML contents...i needed it urgently
    Thanks

    actually i have a print button on html page....when i click on print button using window.print(); the html page gets printed...but along with it print button is also printed...i dont want print button to be printed...
    this is the issue...
    please resolve it
    Thanks a lot...

  • HT1725 I had an itunes redemption code for a movies and got the following message: "code redemption temporarily unavailable. Try again later." several times.  How do I get my movie?

    I had an itunes redemption code for a movie and got the following message, "code redemption temporarily unavailable. try again later."  How do I get my movie?

    Hi r.viel,
    I'm sorry to hear you are having issues with your redemption code.
    The following article should help you with this:
    iTunes Store: Invalid, inactive, or illegible codes
    If you're still unable to redeem your code after verifying the characters in the code, you'll need to contact iTunes Store Support for help. You'll need to provide a digital image of the front and back of the gift card as well as the sales receipt for the purchase of the gift card.
    Contacting iTunes Store Support
    Go to the iTunes support page and select your iTunes country.
    From the iTunes support page, choose Contact Support on the lower-left side of the page.
    Follow the instructions to get iTunes Store support assistance.
    I hope this information helps ....
    Have a great day!
    - Judy

  • Hi can someone explain what the following error code mean and how i can recifty to download a copy of ebook purchase Error getting License. License Server Communication Problem: E_ACT_NOT_READY

    Hi can any one help
    I keep getting the following error code when I try and down a ebook which I have purchase
    Error getting License. License Server Communication Problem:
    E_ACT_NOT_READY
    can someone advise me what this means and how I recifty the problem to enable me to read the ebook purchase?
    Thanks

    I am having this exact issue. I just downloaded a book and went to open it and got this exact problem.
    I purchased he book through indigo/kobo edition and paid for it and immediately went to open it and am getting the same error
    Error getting License. License Server Communication Problem only mine says  Bad Device key after.
    Not sure why someone has not answered this question yet...i am using windows 7 and this is how i always do it. Never had this problem before when purchasing a book.
    i hope someone answers this soon.

  • How to check JNDI contents after 9iAs startup?

    Dear all:
    How to check JNDI contens after 9iAs server startup ?
    Does the 9iAs have JNDI tree can show all JNDI contents.

    Hi,
    define ValueChange listeners on the component and when the user hits the command link or button to navigate off t he page, check if it has been changed (the listeners would set a bloolean variable). For this to work, the navigation action needs to be handled by the bean too.
    Frank

  • I can't upgrade and purchase on my ipad. when I am trying to buy the following message appears on the screen, you have no account in canada store please change it the UK, How can I change it?

    I can't upgrade and purchase on my ipad. when i am trying to buy the following message appears on the screen. "you have no account in canada store please change it the UK. how can I change it?

    Try this.
    Settings>iTunes and App Stores>Apple ID
    Tap your ID
    Tap View Apple ID
    Enter your password
    Go to country/region in the popup window to change the store

  • I have recently restored everything on my iMac after getting a new hard drive. When i try to use Elements, i get the following error code   ERROR  150:30. Any ideas?

    I have recently restored everything on my iMac after getting a new hard drive. When i try to use Elements, i get the following error code   ERROR  150:30. Any ideas?

    Did you use migration assistant to copy over programs, documents, and settings? You can't do that with PSE. Elements is not a tidy package in accordance with the apple developer guidelines. The installer strews stuff all of your hard drive in place the migration assistant isn't programmed to look and you can never hope to find all h the bits. You must always install PSE from scratch on a new machine. By attempting to copy it you have made a lot of trouble for yourself.
    You will need to download and run this:
    Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    and then you can go around and manually remove what you can reach. Look in applications, your hard drive>library>application support>adobe, your username>library>preferences. In the user library also delete any saved application states for PSE.
    Then you can reinstall from scratch.

  • TS3140 I tried to order a book on iPhoto but got the following message from apple :  the file contains text with drop shadows. As a result, Apple is unable to process your order"  Does anyone know what this means and how to fix it?   Thanks!!

    I tried to order a book on iphoto but got the following message from Apple  : "the file contains text with drop shadows.  As a result Apple is unable to process your order"  Does anyone know what this means and how to fix it?  Thanks!! 

    Hello Katiebell62
    Check out the troubleshooting steps to try and resolve your issue with purchasing a book through iPhoto.
    iPhoto: Difficulty submitting a book, card, or calendar order
    http://support.apple.com/kb/TS2516
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Please help me.. how to rewrite the following java- for loop code in ada

    int i, j, n = 100;
    for (i = 0, j = 17; i < n; i++, j-- )
    sum += i * j + 3;

    how to rewrite the following java- for loop code in ada
    You should have a programming manual for Ada first. If you mean it the other way round, I think you subject line confused me.

Maybe you are looking for