Open new window using java code and not in script

i need some method like sendredirect or forward . where i can make some codes so as to open a new window.
actually i am calling a jsp from one jsp file where a lot of dynamic parameters are sent. and in the second jsp i call a servlet which works to download a file to the client side. i want the file should open in new window not in the browser from where it is initiated.
else can any one say the mime type where i can open file(a xls file) in xls window and not in browser which is not needed as user needs to press the back button(present in browser)

Hi,
in your code
the following code, which is used to set the file name that is to be downloded
response.setHeader("Content-Disposition", "*inline*; filename=somename.xls" );
to be replaced by
response.setHeader("Content-Disposition", "*attachment*; filename=somename.xls" );
it will work fine try it.
Edited by: Bhaskar.krishna on Jan 17, 2008 12:56 AM

Similar Messages

  • New to Java Script(Want to open a new window using Java Script)

    Hi all,
    I am new to using Java Script. Now I have a HTML(First.html) page with a ADD button at the end of the page. What I want to know is, if I drag and select some part of the First.html and click on the ADD button a second HTML page(Second.html) should open displaying only the selected contents....
    Please help :-(

    myRef = window.open(self.location,'mywin',
    'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');

  • When I do a search, with MSN as my homepage, it pops up in a new window not a tab like it used to. MSN says it is Firefox related. How do I fix this? I have the option selected to open new windows in tabs instead and it still won't work.

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [/questions/832115]</blockquote><br>
    I use Firefox 4.0.1 and have MSN set as my homepage. Recently, even with the option set to make windows open in tabs instead, if I do searches on the MSN page, the results pop up in a new window. I contacted MSN and they said it is something to do with Firefox. It didn't use to do this, even after initially upgraded to 4.0.1, but started about a week ago and even with me doing nothing to my computer. How do I get this to stop and go back to new tabs instead?
    It does not do this using Google, AOL, Yahoo, or another other search, just MSN/Bing.

    That's strange. It's possible that you are having a problem with some Firefox add-on that is changing your Firefox's normal behavior. Have you tried disabling all add-ons (just to check), to see if Firefox goes back to normal? Also have you tried uninstalling & re-installing flash? If you need help un-installing Flash see http://helpx.adobe.com/flash-player/kb/uninstall-flash-player-windows.html. You also could try safe mode. See https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode?redirectlocale=en-US&redirectslug=Safe+Mode .

  • Opening a new Broswer Window using Java code inside JSP

    Dear Fellow Java Developers:
    I have written a JSP that presents information about a particular item. I want to give an option to the customer to click on the picture of the item to get a larger view. However, I don't want the browser window that opens to have the usual buttons and menubar at the top like a typical browser window, I just want it to be a window with a large image of the item. A good example of this is on the following website:
    http://www.eddiebauer.com/eb/product.asp?product_id=24701&nv=2|21472|9|32&lview=&cm_cg=&tid=&c=&sc=&lp=w1i005
    Click on the picture of the shirt on this page and you'll see what I am talking about. How is this accomplished using a Java scriplet? I have checked the source code for the above site, as well as others, and they all achieve this using JavaScript. Is there a way of accomplishing this using pure Java and/or HTML?
    Just wondering.
    Thanks in advance to everyone that replies.
    Sincerely;
    Fayyaz

    you seem to miss the client/server side setup. Your java is executing on the SERVER and it processes a request which in turn sends pure HTML and javascript to the client. What you want to do has to be done on the CLIENT, so JavaScript is the only option.

  • Not able to checkout Files using Java Code and SAP BAPI  from DMSServer

    Hi
    Able to download / checkout the files using T-Code SE37 (BAPI_DOCUMENT_CHECKOUTVIEW2).
    But when same RFC is executed from Java, it alsways says -
    Message ::::::::Document LGL/10000000003/000/00 does not exist
    My inputs in Java Code is as below -
    import java.io.*;
    import java.util.*;
    import com.sap.mw.jco.*;
    //CREATED ON - 10-APRIL-2010.
    public class BapiDocCheckOutview {
         public static void main(String args[]){
              try{
                   if(mConnection!=null){
    JCO.Repository repository=new JCO.Repository("AraSoft",mConnection);
    JCO.setMiddlewareProperty("jco.middleware.allow_start_of_programs", "SAPFTPA");
    JCO.Function function=repository.getFunctionTemplate("BAPI_DOCUMENT_CHECKOUTVIEW2").getFunction();
                        //End of get function.
                     System.out.println("Before execution1");
                     if(function !=null){
                   JCO.Field DOCUMENTTYPE = function.getImportParameterList().getField("DOCUMENTTYPE");
                    DOCUMENTTYPE.setValue("LGL");
                    JCO.Field DOCUMENTNUMBER = function.getImportParameterList().getField("DOCUMENTNUMBER");
                    DOCUMENTNUMBER.setValue("10000000003");
                    JCO.Field DOCUMENTPART = function.getImportParameterList().getField("DOCUMENTPART");
                    DOCUMENTPART.setValue("000");
                    JCO.Field DOCUMENTVERSION = function.getImportParameterList().getField("DOCUMENTVERSION");
                    DOCUMENTVERSION.setValue("00");
                    JCO.Field GETSTRUCTURE = function.getImportParameterList().getField("GETSTRUCTURE");
                    GETSTRUCTURE.setValue("1");
    JCO.Field GETCOMPONENTS = function.getImportParameterList().getField("GETCOMPONENTS");
                 GETCOMPONENTS.setValue("X");
    JCO.Field ORIGINALPATH = function.getImportParameterList().getField("ORIGINALPATH");
                  ORIGINALPATH.setValue("C:
    TEMP
    DMS_");
    JCO.Field GETHEADER = function.getImportParameterList().getField("GETHEADER");
                          GETHEADER.setValue("X");
    JCO.Field PF_FTP_DEST=function.getImportParameterList().getField("PF_FTP_DEST");
              PF_FTP_DEST.setValue("SAPFTPA");
    //JCO.Field PF_HTTP_DEST=function.getImportParameterList().getField("PF_HTTP_DEST");
         //PF_HTTP_DEST.setValue("SAPHTTPA");
                          System.out.println("Here Setting Values Inside Structure ::DOCUMENTFILE");
    JCO.Structure DOCUMENTFILE=function.getImportParameterList().getStructure("DOCUMENTFILE");
    DOCUMENTFILE.setValue("1","ORIGINALTYPE");
    DOCUMENTFILE.setValue("WWI","WSAPPLICATION");
    DOCUMENTFILE.setValue("ZHCL_CS","STORAGECATEGORY");
    DOCUMENTFILE.setValue("E0DF7893E2BD5DF19C07001517B4A299","APPLICATION_ID");
    DOCUMENTFILE.setValue("E0DF7893E2BD5FF19C07001517B4A299","FILE_ID");
    DOCUMENTFILE.setValue("X","CHECKEDIN");
    DOCUMENTFILE.setValue("X","ACTIVE_VERSION");
                            //DOCUMENTFILE.setValue("LGL","DOCUMENTTYPE");
                            //DOCUMENTFILE.setValue("10000000003","DOCUMENTNUMBER");
                            //DOCUMENTFILE.setValue("000","DOCUMENTPART");
                            //DOCUMENTFILE.setValue("00","DOCUMENTVERSION");
                          //JCO.Field GETCOMPONENTS = function.getImportParameterList().getField("GETCOMPONENTS");
                          //GETCOMPONENTS.setValue("X");
                          //JCO.Field GETHEADER = function.getImportParameterList().getField("GETHEADER");
                          //GETHEADER.setValue("X");
                        mConnection.execute(function);
    If anyone have an Idea on what I have missed out...
    Please do advice me.
    Thanks
    Prashant

    Hi
    To update in the initial requirement, I have added (prefixed, zeroes) in Document No., doing that, now the  application is able to find the document, but not able to transfer the same from DMS Server to my local Machine, always giving the following error -
    Type ::::::::E
    Message ::::::::File d:\dms\z_IPI_PRASHANT01.doc cannot be created
    Please let me know, if some services needed to checked in SAP System or some more information to be provided in RFC.
    Thanks
    Prashant
    Dear Experts
    Any advice on this. Still not able to download the documents from DMS Server.
    I have also added few more code in my Java program -
         private int use_sapgui;
         public void setSapGui(int use_sapgui){
              use_sapgui = 2;
    PLease help !!
    Regards
    Edited by: Prashantroy on Sep 26, 2011 12:49 PM
    Hi,
    Further to my earlier Mail, while checking the Trace suing SM59 in ECC System I got  the following Error -
    Trace file opened at 20111010 142232 India Standard Time, SAP-REL 701,0,134
    ======> cannot open SAPGUI
    ABAP Programm: SAPLSYSE (Transaction: )
    User: IPI_PRASHANT (Client: 220)
    Destination: SAPFTP (handle: 3, , )
    SERVER> RFC Server Session (handle: 1, 43220900, {5D1DF3E0-ACBD-F11F-8EA0-00A0D1
    SERVER> Caller host:
    SERVER> Caller transaction code:  (Caller Program: java)
    SERVER> Called function module: RFC_START_PROGRAM
    Error RFCIO_ERROR_SYSERROR in abrfcpic.c : 1742
    FUNCTION: 'exec_sapgui'
    cannot open SAPGUI
    PROG =sapftp erpdev sapgw00 43232164 IDX=4
    Can someone help me in getting this sorted out.
    Thanks N Regards
    Edited by: Prashantroy on Oct 10, 2011 2:32 PM

  • Issue when opening new windows using JSF CommandLink

    Hi,
    I'm opening this thread to follow up on a topic posted on the old Sun Developer Forum: http://forums.sun.com/thread.jspa?threadID=5435239 . That post was never answered and I am having the same problem.
    To summarize (and I'll quote from the original post):
    "I am having an issue where when I open a page in a new window from a link in my primary window any button or link clicked on the primary window after that opens a new window."
    "Any other actions on the primary page should keep navigation within the primary window. This issue does not start occurring until after the desired new window is opened the first time."
    Anyone has run into this problem and found a solution?
    Marc

    This is the command link code that, once this gets called, anything else on the page will open this window again:
    <h:commandLink immediate="true" styleClass="commandLink" target="_blank" style="text-decoration:none"
                id="pdfLink action="#{Bean.method}">
         <hx:graphicImageEx id="imageEx2" styleClass="graphicImageEx" value="../images/pdfButton.gif">
         </hx:graphicImageEx>
    </h:commandLink>

  • How to make jar files run using java.exe and not javaw.exe

    Hi ,
    I am developing a project in which there is an GUI which inturn will call a console . I have made it into an jar file now.
    Here comes the problem. When i run the jar files , i don't get a console. While going through this forum, i came to know that jar runs using javaw.exe and this stops it from bring the console up.
    Please suggest me a way of running the jar file through java.exe or any other method by which i can get an new console poping up.
    PS : i cannot start the application itself in a system console , because the Console mode is an added feature and it is not to be displayed every time but only when the user intends to.

    Thanks for the reply pbrockway2. But i think, i was not able to convey my problem properly.
    I am supposed to start my application in a GUI mode ( No console are should be present at this point of time). Within the GUI , i have a option for working in the console ( i.e if console is choosen, then i start giving my output and take inputs from the console. I am trying to do this by just calling the "System.out "and "System.in" methods. )
    Here is the problem. As i have started it through " jar " it would not have a associated console with it.
    PS: i cannot have launching .bat file because that would result in my application having a console displayed at the very start of the application. I want the console to be displayed only when the user wants to start in console mode.
    Please suggest me some ways of doing this. Can i create a console from my java program and then exit it.

  • Required information about opening new window using hotkeys...

    Hi,
    From my application page, a new window have to popup with few of my table fields (it should be a separate window, Not like when you right click on page you will get a popup with cut, copy, paste etc) using HOTKeys. Kindly point me to the useful docs.
    Regards,
    SelvaKumar S

    Do you mean you need [javax.swing.Popup|http://java.sun.com/javase/6/docs/api/javax/swing/Popup.html] ?
    Create a Popup using PopupFactory, using a Component which listens to your hotkeys.

  • How to set schedule task in windows using java code

    Hi,
    i want to set the schedule task in windows os using the java code can any one help me on that
    can any one thinks i need to wright a dll file for that which set the schedule task for me which dll i can use in my java code.
    thanks in advance.

    Maybe this will help you?

  • Any way to open new window using af:commandButton or af:commandLink?

    There are plenty of examples for doing this as a modal dialog.
    However, we need the new window to be independent of the parent (i.e. the parent should still be active).
    Anyone know a way of doing this?
    Thanks,
    - Bill

    How about using an goButton or goLink and setting the target property to _new?                                                                                                                                                                                   

  • Open new window using javascript in flash

    what is wrong with the following? I keep getting the 3 errors
    below. I have checked and rechecked but can't find my mistrake.
    on (release) {
    getURL("javascript:newWindow=
    window.open('
    http://websitemedia.net/playground/ferrioni/sandbox/ferrioniaddress.html','popper1',
    'width=425,height=300,scrollbars,resizable');
    newWindow.focus(); void(0);");
    Errors are below:
    **Error** Symbol=contact, layer=Layer 1, frame=1:Line 2:
    String literal was not properly terminated
    getURL("javascript:newWindow=
    **Error** Symbol=contact, layer=Layer 1, frame=1:Line 3: ')'
    or ',' expected
    window.open('
    http://websitemedia.net/playground/ferrioni/sandbox/ferrioniaddress.html','popper1',
    **Error** Symbol=contact, layer=Layer 1, frame=1:Line 5:
    String literal was not properly terminated
    newWindow.focus(); void(0);");
    Total ActionScript Errors: 3 Reported Errors: 3

    i am now down to only 1 error. How the script looks and the
    only error generated are below.
    on (release) {
    getURL("javascript:newWindow=
    window.open('
    http://websitemedia.net/playground/ferrioni/sandbox/ferrioniaddress.html','popper1',
    'width=425,height=300,scrollbars,resizable');
    newWindow.focus(); void(0);");
    error below:
    **Error** Symbol=contact, layer=Layer 1, frame=1:Line 5:
    String literal was not properly terminated
    newWindow.focus(); void(0);");

  • Make start screen tiles open new window by default?

    let me preface this by saying "I like the windows 8 start screen and I don't miss the start menu."
    but.
    the default behavior for start screen tiles seems to be "take me to the open instance of this application."
    if I click the notepad tile to open notepad, it opens notepad. if I click the tile again, it takes me to that notepad I just opened the first time I clicked the tile. if I want to open two instances of notepad, I have to right-click the tile and then
    choose "open new window," which may or may not be on the complete opposite corner of the screen from my notepad tile.
    for what it's worth, this was not the behavior in the old start menu.
    is there a registry hack or group policy I can put in to say "start tiles always open a new instance of desktop apps"? I use two monitors and have a lot of things open. sometimes I might not even remember that I have notepad (or remote
    desktop, or excel, or powershell) running until I've already clicked the tile "again" instead of right-clicking and choosing "open in new window." this may seem like a minor thing, but it just seems like something I should have a *choice*
    on.
     the unfortunate flip side of this is that the new dual-monitor taskbar does what exactly what I want the start screen to do, but what I DON'T want the taskbar to do. that is, if I:
    A. have a outlook pinned to the taskbar on my primary monitor
    B. have outlook open on my second monitor
    C. click the pinned outlook icon on the first monitor
    windows opens a new instance of outlook instead of just taking me to the open instance. and as if to twist the knife and say "i'm doing this wrong on purpose," it opens this new instance on the second monitor, right in front of the first
    instance.
    so the start screen knows if outlook is open on either monitor, but the taskbar on monitor1 doesn't know/care if outlook is open on monitor2.
    (any of this addressed in 8.1?)

    For those domain administrators need to push this to multiple users, but don't want to change the registry setting on each and every users (could be hundreds, or even thousands of them), here is a GPO template I made so you can push the registry change
    to selected domain users and groups.
    Just paste the following into an ADM file (i.e. AlwaysLaunch.adm) and then create a new GPO and import it under
    Administrative Templates, then apply the GPO to the domain users and groups that you want to apply this behavior to.
    CLASS USER
    CATEGORY !!CustomBehavior
     KEYNAME "SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell\Launcher"
     POLICY !!AlwaysLaunchNewInstance
      EXPLAIN !!AlwaysLaunchNewInstanceHelp
      PART !!AlwaysLaunchNewInstance DROPDOWNLIST REQUIRED
       KEYNAME "SOFTWARE\Microsoft\Windows\CurrentVersion\ImmersiveShell\Launcher"
       VALUENAME "DesktopAppsAlwaysLaunchNewInstance"
       ITEMLIST
        NAME !!Disabled VALUE NUMERIC 0
        NAME !!Enabled VALUE NUMERIC 1 DEFAULT
       END ITEMLIST
      END PART
     END POLICY
    END CATEGORY
    [strings]
    CustomBehavior="Custom Behavior Settings"
    AlwaysLaunchNewInstance="Always Launch New Instance When Running An App"
    Enabled="Enabled"
    Disabled="Disabled"
    ; explains
    AlwaysLaunchNewInstanceHelp="When running a new application, normally it will go to an existing one if it is already open.  Most of the time this is undesirable, and you want a new instance to run."

  • How to compare two huge xml files(50MB+) using Java Code

    I want to compare two huge xml files using java code and need to find the difference of those xml files
    is there any API for that

    You should find third party API

  • How do I forces FF 23 to open maximized, not full screen, but maximized, both on start up and when opening new windows?

    Firefox 23 does not open maximized nor does it open new windows maximized. As such I have to manually maximize each window.
    Run is set to maximized in the shortcut properties, yet it still opens in a normal or less than normal size window.
    Older versions open maximized with no problem. I have Profile manager configured so that I can run multiple versions at the same time and everything opens maximized except FF 23.
    is there some setting in the about:config interface or is this a genuine BUG in the latest version? Any help would be appreciated greatly.
    Also can you tell me how to modify the title bar text/icon/etc as well as where to find the icon or portable network graphic (png) file for the main-window.ico or direct me to appropriate knowledge base articles for modifying both.

    My localstore.rdf file was fine. The problem was caused by two plug-ins that Mozilla shows as being compatible with Firefox 23, when in fact they both cause undesired side effects.
    Maybe the employees of Mozilla should actually test plug-ins before they allow them to be available for download or worse yet, recommend them.
    And if any of the in-house developers had a clue they would stop removing old lines of code from Mozilla products so that new versions of Firefox would still be compatible with older plug-ins and extensions people would still like to use.
    I had to remove recommended extensions and copy code from older versions of FF and NS and modify settings in about:config to allow older extensions to work to correct the problems and get Firefox to work the way I need it to. All in all I have over forty hours invested in modding FF at this point just to have it function the way it used to.
    Unfortunately, since I still can't get buttons designed to open .URL links from the toolbar to work as they did in the past I have a feeling I'll be returning to older code sources to find more answers.
    Lucky for me that I have every browser going back to NCSA Mosaic available to me, so every bit of code from the present till back before Mozilla existed is include in my knowledge base. It's a shame Mozilla doesn't keep such a reference available for it's users or apparently it's in house developers and staff.
    Maybe I'll even re-enable the splash screen for Firefox since the only available plug-in for that doesn't appear to work with Version 23 either, even though once again the compatibility adviser says it does
    It's truly sad that the result of Marc Andreessen's and James Clark's work and Netscape in general became the spawning Mozilla. What used to be a great browser and an acceptable replacement for Netscape, has become a joke. So much for all the hard work and effort made by Dave Hyatt and Blake Ross as well.
    I guess that's what one should expect from the developers that are a part of generations X, Y, and Me. The attitudes associated with those generations show in the lack of thought, consideration, and ingenuity that have been a part the last several versions of FF, not to mention, the copying of features from Chrome.
    When the only original idea to come out of Mozilla of late is to remove or disable features people have used and counted on for decades, the I don't care, I don't know, and me, me, me attitudes of so many from the aforementioned generations is truly evident in the last twenty incarnations of Firefox. Not to mention the attitudes and unhelpful nature of the responses users encounter when asking for help.

  • In version 3.6 I can not open a website link from original page, I keep getting a new window that is blank and asking me to put in a web address. What has changed with the new version?

    When on a page if I click on a web link I get a new window that is blank and asks me enter a web address. This started happening with the new 3.6 version. It seems to have something to do with what I choose for the location in my privacy settings as the window changes with each setting but I still cannot get to the new site. Any ideas? I have no problem with this in IE and I have to keep opening IE when I encounter the problem on Firefox which is annoying.

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

Maybe you are looking for

  • Halt causes jerk movement

    Using PCI-7344 and MID-7604 and FLEXMOTION. 3-Axis control, stepper motors, closed loop with optical linear encoders. 1) When I am stationary and command a Halt, there is a resulting jerk movement, sometimes up to a few 1000 servo steps. Why? 2) The

  • Sun Java Systems Application Server 9 connection-pool ping error

    Hi folks, I tried creating a javax.sql.DataSource MSSQL database connection pool with the jdts type 4 driver I got from sourceforge, and each ping operation I tried gave me the following error message: Operation 'pingConnectionPool' failed in 'resour

  • Issue with stock qty of component in Structured Articles in SAP BI

    Dear Experts, We are extracting stock in BI through SAP standard data source. We have used 2lis_03_bx and 2lis_03_bf data sources. We are facing issue with stock data validation due to structure articles (pre-pack) available in SAP source system. We

  • Debug weblogic.properties conversion error

    All, I'm attempting to use the web console application/Convert weblogic.properties link to perform a propterties file conversion. I'm getting a conversion error when converting our current weblogic.properties file. This properties file is working fin

  • How do i make a collage bigger then 300mm x 300mm thats all it lets me do

    I'm trying to make a collage bigger then 300mm x 300mm as it wont let me go any bigger and i would like to go bigger and i don't know how?