How to include a static file.... Please help..

Hi guys..
i am going crazy here, so please help.... is it possible to use <jsp:include page="headlines.html" flush="true"/> to serve a static file( headlines.html) which is in say tomcat_home\bin.. also, i wonder why the following code creates a headline file in the bin folder in the first place.. i thought, it should create headlines.html in the same folder as this class...i am a newbie as you can see...thanks in advance
package beanpackage;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import java.io.FileOutputStream;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import java.io.File;
public class RSSProcessor {
public RSSProcessor(){ }
String _RSSFile;
public String getRSSFile(){
return _RSSFile;
public void setRSSFile(String fileName){
try {
StreamSource source = new StreamSource(fileName);
StreamSource finalStyle = new StreamSource("final.xsl");
String outputURL = "headlines.html";
StreamResult result = new StreamResult(new
FileOutputStream(outputURL));
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer(finalStyle);
transformer.transform(source, result);
} catch (Exception e) {
e.printStackTrace();
}

I am just about there thanks to you stibrian..
as you know that i am using a bean and a jsp to transform the rss feed.. following your direction i used String filePath = getServletContext().getRealPath etc. in my JSP and i am getting my headlines.html in the ROOT folder every time i reload the JSP.. thats great ! but my <jsp:include page="headlines.html" flush="true"/> is still not working(i tried every possible combination).. is there any thing wrong? I will post my new code below and i hope that i would not bother you again (on this:-).. thanks a lot.. also, i will add some dukes to this question, as a thank you..
package beanpackage;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.stream.StreamResult;
import java.io.FileOutputStream;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import java.io.File;
import java.io.*;
public class RSSProcessor {
public RSSProcessor(){ }
String _RSSFile;
public String getRSSFile(){
return _RSSFile;
public void setRSSFile(String fileName, String outputURL){
try {
StreamSource source = new StreamSource(fileName);
StreamSource finalStyle = new StreamSource("final.xsl");
//String outputURL = getServletContext().getRealPath("WEB-INF" + File.separator + "headlines.html");
     //String outputURL = "headlines.html";
StreamResult result = new StreamResult(new
FileOutputStream(outputURL));
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer transformer = transFactory.newTransformer(finalStyle);
transformer.transform(source, result);
} catch (Exception e) {
e.printStackTrace();
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<jsp:useBean id="rssBean" scope="request" class="beanpackage.RSSProcessor">
<%@ page import="java.io.File"%>
<%String outputURL = getServletContext().getRealPath(File.separator + "headlines.html");%>
<%
rssBean.setRSSFile("http://www.rediff.com/rss/inrss.xml", outputURL);
%>
</jsp:useBean>
<html>
<head>
<title>Syndicated Feeds</title>
</head>
<body>
<jsp:include page="headlines.html" flush="true"/>
</body>
</html>

Similar Messages

  • How to view corrupted word files, please help?

    Can't view doc corrupted file .How to recover unsaved documents WORD? how to view corrupted word files, please help

    It could be Word or even Windows that is having the problem. Before you start trying to restore a backup or repair a file, try opening other documents.
    Try opening your "corrupt" document from another computer. Also you can try to make a copy of corrupted files. (It could work) : http://www.filerepairforum.com/forum/microsoft/microsoft-aa/word/968-i-would-be-grateful-for-any-help-to-repair-or-the-procedures-word-files
    But if nothing helps, you can try to recover it by using DOCX Viewer Tool Download free demo versions of this software from website: http://www.docx.viewertool.com/ It’s
    gonna help.

  • How To Edit a .pdf file - Please Help!

    When I Googled the above question, I was told to download the Adobe Acrobat XI.
    I tried downloading the trial version. I was then told to download the Creative Cloud to  be able to download Acrobat XI.
    I downloaded Creative Cloud, then I was taken to the Adobe Applications Manager Page which show a bunch of apps to download.
    I don't  know which app I will need for the editing.  I was looking for Acrobat XI, but it's not showing anywhere.
    I tried downloading Photoshop. This took more than 2 hours. After the download was complete, I tried launching it, but nothing happened.
    I went back & double-checked the instructions, & I'm directed & got stumped at the Applications Manager page once more.
    I find this very frustrating. I wish it were not this complicated.
    I just want to edit a .pdf file, and nothing else. I'm not sure if I want to go through all these maze, or just use FIVVER, pay $5.00 & AVOID all these hassles.@nikoledeon.
    PLEASE HELP!

    Downloads available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  12 | 11, 10 | 9,8,7
    Lightroom:  5.5 (win), 5.5 (mac) | 5.4 (win), 5.4 (mac) | 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • How to include a static file which is outside Applicaton Context in JSF?

    I need to inlcude lot of static contents which are residing in outside Application Context root in JSF.? is there any better way to do include static files which are outside the Context root?

    The total no of static content files will be around 20000 to 30000 and i will only know the file name at run time from the user input.

  • How to play the audio file please help me

    i would like to play audio files such wav files, au files etc
    I would like to know how to play audio file easily in Applet and
    applications
    Thank you

    import sun.audio.*; //import the sun.audio package
    import java.io.*;
    //** add this into your application code as appropriate
    // Open an input stream to the audio file.
    InputStream in = new FileInputStream(Filename);
    // Create an AudioStream object from the input stream.
    AudioStream as = new AudioStream(in);
    // Use the static class member "player" from class AudioPlayer to play
    // clip.
    AudioPlayer.player.start(as);
    // Similarly, to stop the audio.
    AudioPlayer.player.stop(as);

  • After Effects SWF file appears black with no image. Only 2 layers in AE file (one that moves the other static). Please help!

    After Effects 5.5.
    I need this file as a swf but it appears black when I export.
    Only 2 layers in AE file (one that moves the other static). Please help!
    Thank you!

    Thanks for your response. Is there no other way to get the swf file to work properly from After Effects?
    What is the best way to go about using the MP4, F4V or FLV formats to save as a swf in Flash?
    Can you advise how I can save it to MP4, F4V or FLV from After Effects Creative Cloud? they don't seem to be visible (I also have creative cloud)
    Thank you very much

  • HOW TO - Create new from clipboard and process multiple files - please help

    Need help - have new version of photoshop on trial only ATM...
    Want to know - HOW TO:
    1. Create new from clipbaord
    2. Process multiple files
    Please help.

    For clipboard copy, I start with File > New and the size will be set to what's in the clipboard. Then once the new file is opened, Edit > Paste will place the clipboard contents as a layer in the new document.
    You must remember to use the command Layer > Flatten Image of you want to save as jpeg or any other file format that doesn't support layers.
    For processing multiple files,
    File > Automate > Batch or
    File > Scripts > Image Processor...
    Check the User guide or google information for those commands if you have specific needs.
    Gene

  • HT1386 I keep getting an error messagwe when syncing: iphone cannot be synced. Aduplicate file name was specified. What does this mean? How do I fix it? Please help.

    I keep getting an error message when syncing:
    iphone cannot be synced. A duplicate file name was specified.
    What does this mean? How do I fix it? Please help.

    any idea how to fix this

  • I can't open Safari. It keeps giving an alert that says, "Suspicious Activity might have been detected." How do I fix this?Please help. thanks!

    Safari won't work. It flashes an alert. Alert says that a Suspicious Activity Might Have been Detected. Major Security Issue. How do i fix this? Please help. Thanks!

    You may have installed a variant of the "VSearch" ad-injection malware. Follow Apple Support's instructions to remove it.
    If you have trouble following those instructions, see below.
    Malware is always changing to get around the defenses against it. This procedure works as of now, as far as I know. It may not work in the future. Anyone finding this comment a few days or more after it was posted should look for a more recent discussion, or start a new one.
    The VSearch malware tries to hide itself by varying the names of the files it installs. To remove it, you must first identify the naming pattern.
    Triple-click the line below on this page to select it, then copy the text to the Clipboard by pressing the key combination  command-C:
    /Library/LaunchDaemons
    In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.
    A folder named "LaunchDaemons" may open. Look inside it for two files with names of the form
              com.something.daemon.plist
    and
               com.something.helper.plist
    Here something is a variable string of characters, which can be different in each case. So far it has always been a string of letters without punctuation, such as "cloud," "dot," "highway," "submarine," or "trusteddownloads." Sometimes it's a meaningless string such as "e8dec5ae7fc75c28" rather than a word. Sometimes the string is "apple," and then you must be especially careful not to delete the wrong files, because many built-in OS X files have similar names.
    If you find these files, leave the LaunchDaemons folder open, and open the following folder in the same way:
    /Library/LaunchAgents
    In this folder, there may be a file named
              com.something.agent.plist
    where the string something is the same as before.
    If you feel confident that you've identified the above files, back up all data, then drag just those three files—nothing else—to the Trash. You may be prompted for your administrator login password. Close the Finder windows and restart the computer.
    Don't delete the "LaunchAgents" or "LaunchDaemons" folder or anything else inside either one.
    The malware is now permanently inactivated, as long as you never reinstall it. You can stop here if you like, or you can remove two remaining components for the sake of completeness.
    Open this folder:
    /Library/Application Support
    If it has a subfolder named just
               something
    where something is the same string you saw before, drag that subfolder to the Trash and close the window.
    Don't delete the "Application Support" folder or anything else inside it.
    Finally, in this folder:
    /System/Library/Frameworks
    there may an item named exactly
                v.framework
    It's actually a folder, though it has a different icon than usual. This item always has the above name; it doesn't vary. Drag it to the Trash and close the window.
    Don't delete the "Frameworks" folder or anything else inside it.
    If you didn't find the files or you're not sure about the identification, post what you found.
    If in doubt, or if you have no backups, change nothing at all.
    The trouble may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Then, still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.

  • As a new MacBook user I plug in my USB Flash Drive but don't know how to access its contents. Please help. Thanks.

    as a new MacBook user, when inserting my USB Flash Drive, I do not know how to access its contents. Please help. Thanks.

    Open a new Finder window, Finder > File > New Finder Window, and it should appear on the left under Devices.
    If you don't see it there, or to get it to show up on the Desktop: Finder > Preferences... General tab, check External disks to have it show on the Desktop,  Or Sidebar tab, check External disks under DEVICES.

  • How to include assigned .as files in MXMLC ant task ?

    When i use mxmlc ant task, i found that
    the tag <include-sources/> doesn't support !
    ( described by http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7a63.html )
    neither SDK version 3.x nor 4.x
    Are they lying?!
    How to include assigned .as files ?
    Thank you !

    My understanding is that mxmlc will use all available resources in the source path, as needed. Instead of giving it individual resources to include, you simply need to give it the source-path that contains those resources. This is different from a library project, which may need to include individual classes that are never used in that library.

  • I am new with JAR files please help me

    Hi Dear All,
    I am new with JAR files, I know concept, but dont know how to careate JAR, and how do i use it?
    Please help me.
    Thanks

    This tutorial covers that:
    http://java.sun.com/docs/books/tutorial/deployment/jar/index.html

  • HT4623 after the new softtware 6.1 on my iphone i losed my picture , how can i get back ? please help me

    after the new softtware 6.1 on my iphone i losed my picture , how can i get back ? please help me

    Try deleing the download and try again. It is located:
    IPSW file location for Mac and Windows
    If yo restore, the iPod will also be update. You can try that. Just make sure that you backup first so yo can restore from backup
    iOS: How to back up

  • Ios7 update audio is hissing and static. Please help me get rid of this noise so I may enjoy my audio on my iPad

    Ever since the ios7 update my audio is hissing and has static. Please help me get rid of this noise so I may enjoy my audio on my iPad

    Just for the record, this is what I wrote to Apple feedback:
    (If anyone really knows what the problem is, please let us know.)
    Apple iPad mini. Re: Hiss
    Hi. I am one of the very unhappy people who can't use the iPad for recording since getting ios7.  The apple forum is replete with stories like mine: ios6 recording was quiet - ios7 is noisy. I have tried every suggestion. Why won't anybody at apple tell us what the problem is? I have been using macs since 1986. All I want to do is record my songs on my iPad. Unfortunately for me, I recently brought my iPad-mini refurbished so there is no warranty. If I had bought it new I would be at the Genius Bar until I got the problem fixed. Did I mention how unhappy I am?  Here are the specs: 1st gen iPad mini running ios7. Recording onto Multitrack DAW with a Samson Go mic to a 30-pin USB camera adapter, into an apple brand lightening adapter into iPad mini. Everything works fine except for the HISS.
    Jeff

  • I installed lightroom 5 with a 30 day trial and it finished. Yesterday I installed cc and when I open LR5 I need a serial number. What do I do/how do I get one? Please help Tank you

    I installed lightroom 5 with a 30 day trial and it finished.
    Yesterday I installed cc and when I open LR5 I need a serial number.
    What do I do/how do I get one?
    Please help, Thank you.

    Your photos remain in place, the catalog you have been using will remain. After you install Lightroom from the CC, all you have to do is open your existing catalog and continue right where you left off.

Maybe you are looking for

  • Help!  Can't get rid of unwanted volume; machine won't shut down

    Hi everyone, This afternoon I used my Maxtor backup (external firewire drive). After I was done with the backup, I clicked "eject" on the disk icon. I may have physically disconnected the disk too soon after that because I got a message saying the di

  • Satus problem with Third party sales process

    Hi Friends, I have an issue with thrid party sales order processing Step#1 My client runs the sales order for Material Qty p-100 10 p-101 10 p-102 10 step-2 Purchase requisition created and from vendor delivery happened Step-3 My user created billing

  • Report to list all computers and their collection membership

    Hi I am currently working on a site where direct membership is used for collections but a need has arisen to move to AD Queries. I have created a simple powershell script that creates groups based on the contents of a csv file and another script whic

  • Not able to start the oracle database with ASM

    HI all, WE are using oracle10.2.0.1 on OEL5. I have mounted ASM but when i try to start the oracle database, it is asking "db is already started shut it down first" [root@localhost ~]# /etc/init.d/oracleasm listdisks VOL1 VOL2 [root@localhost ~]# [ro

  • Connecting to non-US iTunes stores

    I'm looking to purchase some songs that are on the UK iTunes music store, but not the US store. Is there any way that this can be done?