Lauching an external file from a JSP

HI ALL
I have a compiled HTML help file, which i would like to open from a web page through a simple hyperlink, but if provide it as a link the save it/open from location dialog box comes up. I dont want that to happen, is there anyway to directly launch that file from a JSP.
Help is sincerely appreciated.

If the .chm file contains HTML, and you don't want to rename the extension .html, you can write a simple JSP that opens the .chm file, and writes the contents out to the HttpServletResponse's PrintWriter object.
Let me know if you want to see some code examples.

Similar Messages

  • Opening a rft file from the jsp

    hi all,
    i want to open an rtf file from the jsp. i need to call a rtf file present in some location and convert the file to bytes thereby writing these bytes to output stream and so.. can anyone suggest me here.
    it should be something like this :
    String sFileName = "/kli/terms&conditions/TermsandConditionsLitigation.rtf";
                  File nameOfFile = new File(sFileName);
                  FileOutputStream fout = new FileOutputStream(nameOfFile);
                  response.setContentType("application/rtf");
                  response.setHeader("Content-disposition","attachment;filename=\"" +sFileName+ "\"");
                  ServletOutputStream outs = response.getOutputStream();
                  outs.write(fout);
                  outs.flush();
                  outs.close();satish.
    Message was edited by:
    bobz
    Message was edited by:
    bobz

    Yes, unlike earlier IE versions, IE10 has only one executable, but it can run in 32-bit or 64-bit mode.
    Some details: http://www.sevenforums.com/tutorials/280434-internet-explorer-10-enable-32-bit-64-bit-ie10 -windows-7-a.html

  • Trying to run java class files from my jsp

    I am having difficulty running java files from my jsp. I have compiled my two java classes and inserted them onto my server in the webapps/WEB-INF/classes/scripting directory and have imported scripting.* into my jsp page. The files both compiled ok before the class files were loaded onto the server but when I rty to run the jsp from the server, I keep getting a compiler error. Thanks in advance
    Iob

    Here are the few question
    1) Does your java classes which u created is declared under package scripting. *.class files are to be places under the WEB-INF/classes directory only. Not under scripting. But if you java classes say are under a package called a.b. Then you need to put under classes\a\b\.

  • How to call a .js file from a JSP in JSPDynpage

    Hi ........I have a javascript file called set.js under the scripts folder .
    I need to call this .js file from my JSP in a JSPDynpage Application.
    Please help me do this..
    Regards
    Smita

    Hi,
    store your js file also under the jsp folder with a .jsp extension and then call it in your jsp page by an include statement. this was found working. later you may try with changing the extension to .js and try your luck:)
    <%@ include file="set.jsp" %>
    Chill,
    Steel

  • Writing XML file from a jsp page

    how can i write a xml file from my jsp and store the values and after sometime, for example when the user clicks on the submit button, i check the values from xml file and compare those values from the data base.
    it means both writing and reading xml file from a jsp page...
    urgent help needed......thanks

    You need some API like XSL or JDOM to read data from/to XML file
    you can get a best tutorial from
    http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom.html
    and
    http://www.javaworld.com/javaworld/jw-07-2000/jw-0728-jdom2.html
    after reading both articals you will be able to do both the tasks

  • Dynically update JAR file from a JSP

    i need to put a dynaically created text file from a JSP into a JAR file that will be downloaded by the user. I tried creating a special object from doing this and calling it from the JSP page. When run by itself the object ran file, but when called from the JSP it doesnt work. I put the process of creating the text file in the JSP and it worked however I'm stilll unable to update the JAR file with this newly created text file.
    I created a shell script to update the jar but that still didnt work. I know that this is very insecure too ( i guess there are restrictions on calling system commands).
    So is there a way to put this dynamically create file into a JAR directly from JSP without calling system commands
    Thanks

    Yes, use ZipOutputStream.
    but when called from the JSP it doesnt workSo? Figure out WHY it doesn't work, the fact that you are calling the class from a JSP is not the reason why it is failing, it's a programming mistake inside the class itself. Maybe the class is working but it is creating the jar somewhere where you are not expecting it?

  • Loading External Files From SWF Root

    Hi All,
    I do not know anything about flash.  I have been provided with some flash movies/apps to include in a web design that I am doing.  These flash movies load an external xml file.
    This is failing.
    The problem appears to be that when the flash movie goes to load the file using a relative directory path, it starts at the very root of the web directory, where the main jsp file is, instead of the where the .swf file is located.
    For example, say my website is www.mywebsite.com/mysite.jsp and I have stored the flash in a directory similar to /mywebsite.com/flash/movie1/movie1.swf.
    When the movie goes to play, I am getting a 404 error in firebug because the flash movie is trying to load the external xml from /mywebsite.com/file.xml instead of /mywebsite.com/flash/movie1/file.xml.
    How can this be corrected?  Is there a way for the flash application to use the .swf root directory instead of the .jsp file root directory?
    I hope this made sense.  Good chance it doesn't. 

    When you load the Flash file into a web page, the web page becomes its frame of reference for loading other content.  So to fix this situation you should either relocate things to where the Flash file lives in the same directory as the web page that loads it, or retarget the files that the Flash file is loading as if it were in the web page's folder (using absolute paths should guarantee correct targeting).

  • How can I write to a (external)file from a stored procedure

    I want to write some data to a (external) file. I have it working with the function UTL_FILE.
    My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
    Does anyone know a way to build this.
    Please send your responses to [email protected]
    Many thanks,
    Alex Nagtegaal

    an extraction out of expert one-on-one from Thomas Kyte
    <quote>
    when an oracle istance is created the services that support it are setup to 'log on as' the system (or operating system) account, this account has very few privileges and no acces to Window NT Domains. To access another Windows NT machine the OracleServiceXXXX must be setup to logon to the appropriate Windows NT Domain as a user who has acces to the required location for UTL_FILE.
    To change the default logon for the Oracle services go to (in Windows NT):
    Control Panel | Services | OracleServiceXXXX | startup | log on as; (where XXXX is the instance name)
    In Windows 2000, this would be:
    Control Panel | Administrative Tools | Services | OracleServiceXXX | Properties | Log on tab; (again XXXX is the instance name)
    Choose the This Account radio button, and then complete the appropriate domain login information. ONce the services have been setup as a user with the appropriate privileges, ther are two options dfor setting UTL_FILE_DIR:
    * Mapped Dirve: To use a mapped drive, the user that the service starts as must have setup a drive to match UTL_FILE_DIR and be logged onto the server when UTL_FILE is in use.
    * Universal Naming Convention: UNC is preferable to Mapped Drives because it does not require anyone to be logged on and utl_file_dir should be set to a name in the form \\<machine name>\<share name>\<path>
    You will of course need to stop and restart Oracle after changing the properties of the service.
    <\quote>
    I want to write some data to a (external) file. I have it working with the function UTL_FILE.
    My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
    Does anyone know a way to build this.
    Please send your responses to [email protected]
    Many thanks,
    Alex Nagtegaal

  • How to call external files from java?

    How to call external files in java. For example how to call a *.pdf file to open in its default editor(say Acrobat), or a *.html file to open in the default browser or a *.txt file in a notepad etc..,
    In my program i have *.chm (Compiled Windows HTML Help) help file. how to open it in its default editor it?

    Jayarathina_Madharasan wrote:
    no one answered my questionHi what wrong did i do...basically insulted all the volunteers here who took the time to consider your question and try to offer you help. Other than that, you did nothing wrong.
    From JavaRanch :
    And even if an answer doesn't solve your problem, even if it should totally miss the point - the best thing to do to motivate others to continue trying to help you is showing respect and gratitude for the investment of time that was put into dealing with your issue.
    Edited by: Encephalopathic on Apr 14, 2008 10:01 AM

  • Is anyone know how to create dynamic pdf file from a JSP page or Servlet ?

    Hi
    Is any one know how to create a dynamic PDF file from JSP or servlet. I need to have standard form format needs to be created and want to send the info to that form dynamically.
    Is there any libraries available?
    Thanks

    I posted a link in this thread to a lib that lets you create PDFs from an app. They have a Java version. I have not used it but I know someone who used it with Microsoft ASP and they liked it.
    http://forum.java.sun.com/thread.jsp?forum=31&thread=287285
    -S-

  • Launch External Files from SSRS

    I have a report that will list the names of files that are attached to this report in the database.  I would like to include the list of files from the database and allow the users to click or double click the file name and have the file load. 
    Is there a way for SSRS to do this?  The files can be in multiple formats, and in the project that adds the files we can use:
    System.Diagnostics.Process.Start(filepath)
    And it will launch the correct process to view the files.  I have stored the the file itself in an image column, and I also have the full path and the file name in columns as well so I could create a dataset to retrieve the file names and show them
    on the report.
    Anyone have any suggestions?
    Thanks.

    Hi katghoti,
    If I understand correctly, you want to embed external files (word, pdf, image etc.) into a report in Reporting Services. If in this scenario, I suggest that you can use the following two methods to achieve your requirement:
    Embed these files into database.
        1) Use the SQL commands to embed these files in database as the image data.
        2) Use the .net language (C#, VB) to convert this data into the image.
        3) Use the image control to show these images, which are files embedded in database.
    Reference:
    How to embed a pdf document in Reporting Services
    Upload these files in the report server, access them using URL.
        1) We can upload these files in the report manager.
        2) Adding hyperlinks to reports to link to these files stored on the report server.
    Reference:
    URL Access Parameter Reference in Reporting Services
    How to add a Hyperlink to a URL in Reporting Services
    Hope this helps.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

  • Opening Excel  files from a JSP page

    Hi,
    I am not able to open up an Excel file through JSP.
    I am using following code snippet in JSP page
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","inline; filename=Test.xls");Do i need to do additional settings for rendering Excel from a JSP
    Thanks in advance !!!

    Hi,
    In my application , we have Excel files on the server i.e we are not creating excel sheets.
    I just want to display these static excel files through a jsp.
    I am able to display the excel files by reading them into ByteArrayOutputStream
    <%
    response.setContentType("application/vnd.ms-excel");
    response.setHeader("Content-Disposition","attachment; filename=B.xls");
    ServletOutputStream so = response.getOutputStream();
    String filename = "D:\\Test.xls";
    String mimetype = "application/vnd.ms-excel";
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    InputStream in = new BufferedInputStream(new FileInputStream(filename));
    byte bytebuff[] = new byte[500];
    for(int lengthread = 0; (lengthread = in.read(bytebuff)) != -1;){
    output.write(bytebuff, 0, lengthread);
    byte data[] = output.toByteArray();
    response.setContentType(mimetype);
    so.write(data);
    in.close();
    so.close();
    %>But my question is that , do i really need to do all this for rendering excel through a jsp.
    Can't i do it by just setting the content type ?
    Thanks

  • Can i cal .fmx file from a JSP Page

    Hi,
    i have Forms Runtime loaded in my System. i able run the .fmx file from Windows Run command. But i want run the fmx file from a link of JSP Page.
    is it possible... plz let me know
    [email protected]

    U can not .
    U can only if you are using an appliction server to run the forms. In this case you can call the URL to run the forms from JSP
    Rajesh ALex

  • Launch external files from a presentation

    preparing a long presentation with many external files (of many kinds: swf, quicktime, html, etc) as examples.
    I am trying NOT to stop the keynote, go thru the finder launching different files in front of the audience.
    I would much prefer if i can use a button inside my presentation to launch that specific file.
    Any ideas? 3rd party plug ins? automator script?

    Keynote has no scripting capabilities what so ever :/.
    Obviously some of the file types you describe can be placed into the Keynote presentation itself. QT, Insert Menu> Webview for web page inside presentation; with textbox selected... Insert menu >Text Hyperlink > Webpage to change to browser and link to url. Email message?! Not files as such though.
    I'm sure you could write an applescript to run in parallel to the presentation to handle all the file launching in a sequence for you or even with a list of buttons if you wanted to get really serious with UI builder.
    Flash support was dropped as a consequence of changes to QT. Flash support inside QT was discontinued (security?).

  • Running an external program from a JSP

    Can anyone help me? I have the following code which works for simple commands such as "ls ./dirname " but not for larger programs. The code works with programs such as FASTA and BLAST in standalone Java programs, but not in a JSP.
    String s = "Path of program to be run";
    Runtime rs = Runtime.getRuntime();
    Process p = rs.exec(s);
    p.waitFor();
    BufferedReader stdout = new BufferedReader(new InputStreamReader(p.getInputStream()));
    while((s = stdout.readLine()) != null){
       out.print(s);
    }Any advice would be greatly appreciated.
    Cheers,
    Tom

    woawow: this one is really scary! starting applications from a JSP!!
    don't you have another integration option? i wonder how thread safe is this approach... you try starting a new thread for this operation ?

Maybe you are looking for

  • DAC fails to load the BAW

    Hello all I am trying to get Oracle BI Applications running on eBS 11.5.10. But dac fails to complete. When I look in the sesslog I see the following output: TM_6708 Warning: undocumented configuration parameter used [SiebelUnicodeDB,APPS@VIS OLAP@VI

  • Complex Mapping - Reset context

    Hi everybody, I have to transform one scenary RFC to FILE, but I had many problems becouse the contexts level of each structures is very different. In my RFC I have two tables, T_HEADER and T_ITEM like: 1- RFC    1.1- T_HEADER    1.2-T_ITEM and in my

  • FITE_EXPENSES  -- Available Travel Requests / Plans

    Hi Experts, I've got a question concerning the creation of travel expenses and the data acquisition of the respective travel request. Let's say I've sent a Travel Request and it has been approved by the respective approver, i.e. status of the process

  • Batch is not captured in MMBE as Schd. for Delivery?

    Hi SD Experts Particular batch stock is not captured in MMBE as scheduled for delivery after creating the Outbound delivery. Kindly provide some inputs. Thanks/Karthik

  • Problemas con facebook

    La aplicación de mi ipod touch no me deja publicar nada, ni comentar... Que puedo hacer?