In a JSP how can access an XML where the XML is present in JAR file in the

All,
The Requirement is as below,
I have a JSP LaunchMe.jsp, and I have a jar utils.jar. both are present in my deployable war file.
And I have an XML Details.XML present in the utils.jar file.
Here I want to access Details.xml in the LaunchMe.jsp.
Can any one please let me know how can I do this.
Thanks,
Subramanyam V

Yes. You have to understand that to read a FILE (one that is seen as a file by your OS), you probably use a FileInputStream, which is a special case of InputStream. When the 'file' is not a FILE anymore, but an entry in a jar (the OS does not see it, only utilities like WinZip or jar see it), you cannot use a FileInputStream, but some other InputStream. Which one? The one returned by getResourceAsStream(), whatever this is (you don't really care). And all the rest will nicely fall into place.

Similar Messages

  • How can I find out where the Library files currently used by iTunes are located?

    I have had a bit of a nightmare sorting out my iTunes files so I have various versions of Library files all over the place. How can I tell where the Library file that iTunes is currently using is located? In Preferences I can see the Library "Name", but I don't think that is much help. Preferences also shows where my i-Tunes media folder is but not where the Library files are.
    Any help greatly appreciated.
    J

    Ah, I was assuming you would search in Finder and display some details. All alternative approach is to Option start iTunes and click the Choose option. It should show a file selection box targeted at the folder of the currently active library.
    tt2

  • Datasheet pasting - how can I figure out where the errors are?

    For example, I am trying to paste a fairly large chunk of data into the Datashet view to use in a list.  (about 30 columns by 9000 rows, so 270,000 cells.) When I try to page, it tells me that about 800 could not be pasted, but does not tell me WHICH
    cells, or even which COLUMNS.   I am sure that if I could just figure out which cells were not being pasted, I could easily figure out WHY there is an error.  Can anybody give me any useful tips to help me pinpoint which columns/cells are having
    the problem? Thanks!

    Hi,
    According to your post, my understanding is that to paste 270,000 cells data into the Datashet view to use in a list.
    Please make sure the view have sufficient columns, otherwise the paste operation will fail.
    A paste operation will also fail in the following situations:
    Some or all of the destination cells are read-only
    Pasting the contents into the selected cells will make them fail the validation rules
    Attempting to paste data that does not match the data type of the destination cells
    Attempting to paste data into a calculated column
    More information:
    Bulk copy and paste into a SharePoint List:
    http://clintoncherry.wordpress.com/2008/02/27/bulk-copy-and-paste-into-a-sharepoint-list/
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How can I send request to the server through XML using JSP

    How can I send XML request to the server using JSP and servlets

    Ajax may be the one way.

  • How can i generate xml like this?

    Hi all,
    How can i generate xml like this & i need to send it to via HTTP :
    <mms>
                 <subject>message subject</subject>
                 <url_image>http://image_url</url_image>
                 <url_sound>http://sound_url</url_sound>
                 <url_video>http://video_url</url_video>
                 <text>message text</text>
                 <msisdn_sender>6281XYYYYYY</msisdn_sender>
                 <msisdn_receipient>6281XYYYYYY</msisdn_receipient>
                 <sid>to be define later</sid>
                 <trx_id>Unique number</trx_id>
                 <trx_date>yyyyMMddHHmmss</trx_date>
                 <contentid>see note</contentid>
    </mms>& how can i get the value of the sid (for example)?
    I hav tried to generate that xml by using StringBuffer & append, but it's not what i mean...
    Anyone can help me?

    Ok...i got it. But i still hav some problems.
    This is the sample code that i used :
    public class XMLCreator {
         //No generics
         List myData;
         Document dom;
            Element rootEle, mmsEle, mmsE;
            StringWriter stringOut;
            mms mms;
         public XMLCreator(String subject, String image, String sound,
                    String video, String text, String sender, String recipient,
                    int id, String date, String contentid) {
              mms = new mms(subject, image, sound, video, text, sender,
                            recipient, id, contentid, date);
                    createDocument();
         public void run(){
              createDOMTree();
              print();
         private void createDocument() {
              //get an instance of factory
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              try {
              //get an instance of builder
              DocumentBuilder db = dbf.newDocumentBuilder();
              //create an instance of DOM
              dom = db.newDocument();
              }catch(ParserConfigurationException pce) {
                   //dump it
                   System.out.println("Error while trying to instantiate DocumentBuilder " + pce);
         private void createDOMTree(){
              //create the root element <Mms>
              rootEle = dom.createElement("mms");
              dom.appendChild(rootEle);
              createMmsElement(mms);
         private Element createMmsElement(mms b){
              Element subjectEle = dom.createElement("subject");
              Text subjectText = dom.createTextNode(b.getSubject());
              subjectEle.appendChild(subjectText);
              rootEle.appendChild(subjectEle);
              //create url_image element and author text node and attach it to mmsElement
              Element imageEle = dom.createElement("url_image");
              Text imageText = dom.createTextNode(b.getUrl_image());
              imageEle.appendChild(imageText);
              rootEle.appendChild(imageEle);
              // & etc....
              return rootEle;
          * This method uses Xerces specific classes
          * prints the XML document to file.
         private void print(){
              try
                   //print
                   OutputFormat format = new OutputFormat(dom);
                   format.setIndenting(true);
                            stringOut = new StringWriter();
                   //to generate output to console use this serializer
                   XMLSerializer serializer = new XMLSerializer(stringOut, format);
                   //to generate a file output use fileoutputstream instead of system.out
                   //XMLSerializer serializer = new XMLSerializer(
                   //new FileOutputStream(new File("mms.xml")), format);
                   serializer.serialize(dom);
              } catch(IOException ie) {
                  ie.printStackTrace();
            public String getStringOut() {
                return stringOut.toString();
    }when i tried to show the stringOut.toString() in my jsp, it's only showed string like this :
    The Lords Of The Ring http://localhost:8084/movie/lotr.3gp 6281321488448 6281321488448 123 0 20070220114851 LOTR.
    1. Why this is happen?i want to generate xml which its format is like above.
    2. How can i send this xml (put in msg parameter) using jsp (via web) without creating the mms.xml?
    3. if i want to set the msg parameter equal to mms.xml - means that msg = mms.xml, what is the data type for msg? is it an object or anything else?
    Thx b4 in advance...

  • How can access a data member in constructor

    hello,
    I want to know that How can access data member of class in constructor of same class
    Thnx
    Rakesh

    You need to point it at
    some object, like you do in newFile. What's in
    newFile is fine, but newFile isn't called beforethe
    doc= line.actually i have this a bigger program what i have
    send before. i m getting a object of JEditorPane in
    newFile() and asssigning it to epMain.
    Thats why i want to access epMain's that value what i
    have setted in newFile so i dont created a new object
    and assigned in epMain as like
    this.epMain= new JEditorPane();so how I can access epMain's that value what i have
    setted in newFile()
    here is actual newFile method
    public void newFile()
    Component comp=newEditPane();
    JInternalFrame iFrame=makeIF(comp,"Untitled");
    iFrame.setVisible(true);
    if(iFrame.getDesktopPane().getSelectedFrame()!=null)
    selectedFr=iFrame.getDesktopPane().getSelectedFrame();
    Container iContent = selectedFr.getContentPane();
    JScrollPane
    jsp=(JScrollPane)iContent.getComponent(0);
    JEditorPane
    e=(JEditorPane)jsp.getViewport().getView();
    this.epMain=e;
    Hmmn... Rakesh you're so makulit. Do you know what null pointer means? Here read the docs API,
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/NullPointerException.html
    You're displaying html using JEditorPane, why dont you try org.jdesktop.jdic.browser.WebBrowser?
    http://java.sun.com/developer/JDCTechTips/2005/tt0505.html
    Okie? ^_^
    -Ronillo.

  • This installation package could not be opened. Verify that the package exists and that you can access it, or contact the applikcation vendor to verify that this is a valid Windows Installer package." How to fix this installation error?

    Does anyone know, how to fix  ' This installation package could not be opened. Verify that the package exists and that you can access it, or contact the applikcation vendor to verify that this is a valid Windows Installer package." ?

    At what point in the process are you getting this message? Have you tried downloading a fresh copy of the iTunes setup file from http://www.apple.com/itunes/download/ ?
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • HT6114 My Mac Book Pro had a split drive with Windows Microsoft Access on it and it was removed when Mavericks installed.  I need this so how can I go back to the old system?

    My Mac Book Pro had a split drive with Windows Microsoft Access on it and it was removed when Mavericks installed.  I need this so how can I go back to the old system?

    Restore from the backup you had prior to installing Mavericks.
    However, the upgrade should not have altered your partition scheme. Did your erase and format the drive prior to upgrading?

  • My iPad is disabled, but I know the passcode.. When i connect it to iTunes it says it can't access it because it has a passcode. How can i get rid of the passcode without resetting the iPad? And if there is no way to do so, how do I completely reset it?

    My iPad is disabled, but I know the passcode.. When i connect it to iTunes it says it can't access it because it has a passcode. How can i get rid of the passcode without resetting the iPad? And if there is no way to do so, how do I completely reset it?

    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.htmlhttp://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tbhttp://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Devicehttp://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htmhttp://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    You may have to do this several times.
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just canceling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • Can someone tell me how to access Illustrator CC on the cloud. I currently have CC 2014 but I do not want to use it since it is extremely slow for me.

    Can someone tell me how to access Illustrator CC on the cloud. I currently have CC 2014 but I do not want to use it since it is extremely slow for me.

    The Cloud is a delivery process... you still install the program(s) on your computer, and then pay a subscription fee to use the program(s)
    Cloud Plans https://creative.adobe.com/plans
    -and subscription terms http://www.adobe.com/misc/subscription_terms.html
    -Cloud status check 30-or-99 days https://forums.adobe.com/thread/1549838
    OR buy the 3 year old version which is a one time payment Creative Suite 6

  • NewBie : How can I do to compile the samples of XML Parser ?

    How can I do to compile the samples of XML Parser ?
    I must create a Makefile file, and after ?
    Thanks

    It`s for the Parser C++.
    thanks

  • How can I transform XML-DB to Relational DB?

    How can I transform XML-DB to Relational DB?
    I want to transform Oracle 9i XML-DB to Oracle 8i R-db
    please tell me how to do this .
    thank you

    hi
    good
    its idoc_xml or idoc_xml_transform
    go through the below link hope it ll help you to solve your problem
    Check with below link :
    Re: IDOCS_OUTPUT_IN_XML_FORMAT -- IDOCS_OUTPUT_TO_FILE
    Re: any function module to write-xml schema of a idoctype to an internal table
    /people/michal.krawczyk2/blog/2005/11/13/xi-how-to-check-your-idocs-on-a-web-page-from-sapgui -> this will help you
    thanks
    mrutyun^

  • How can I make "No Proxy" the default for accessing the internet?

    How can I make "No Proxy" the default for accessing the internet?

    *Tools > Options > Advanced > Network : Connection > Settings
    If you do not need to use a proxy to connect to internet then try to select "No Proxy" if "Use the system proxy settings" or one of the others do not work properly.
    See "Firefox connection settings":
    *https://support.mozilla.org/kb/Firefox+cannot+load+websites+but+other+programs+can

  • How can access every item on a HorizontalList Component

    Hi,
           I would like to know how can I access every item on a HorizontalList component. What I want to do is something like this:
    My HorizontalList:
    <mx:HorizontalList
            bottom="0"
            backgroundAlpha="0.0"
            id="catalogoOpciones"
            columnCount="3"
            height="80"
            hideEffect="{esconderse}"
            horizontalScrollPolicy="on"
            selectable="false"
            showEffect="{mostrarse}"
            width="100%">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:VBox  height="100%" verticalGap="0" horizontalAlign="center">
                        <mx:Label id="titulo" text="{data.nombre}"  textAlign="center" styleName="nombreOpcionDetallePlato" />
                        <mx:ComboBox id="seleccion" dataProvider="{data.opciones}" labelField="label" labelFunction="funcionLabelComboBox"                                         styleName="comboOpcionDetallePlato" change="dispatchEvent(new Event('cambioOpcion',true))"/>
                        <mx:Script>
                            <![CDATA[
                                public function funcionLabelComboBox(item:Object):String {
                                        return item.label + ", $" + item.precio;
                            ]]>
                        </mx:Script>
                    </mx:VBox>               
                </mx:Component>
            </mx:itemRenderer>
        </mx:HorizontalList>
    What I want to do is to show on an Alert screen the selected index in every ComboBox on the horizontallist:
    for(var i:Number=0;i<horizontalListt.dataProvider.length;i++){
         var indice:Number = (horizontalListt.dataProvider.getChildAt(i) as ComboBox).selectedIndex;
        Alert.show(indice.toString());
    I must add, that the horizontalList is working just fine, the only thing that's giving me problems is the access to every item in the list.
    Thank you very much for your time and help.
    Sebastián Toro O.

    Greg, thank you for your quick response, but your answer is a little ambiguous for me. How can my dataProvider change when the user selects another index? the itemRenderer it's supposed get the information off the dataProvider to fill its ComboBoxes, but when the user selects another index, that change shouldn't have any effect on the dataProvider.
    remember that the itemRenderer is:
    <mx:itemRenderer>
                <mx:Component>
                    <mx:VBox  height="100%" verticalGap="0" horizontalAlign="center">
                        <mx:Label id="titulo" text="{data.nombre}"  textAlign="center" styleName="nombreOpcionDetallePlato" />
                        <mx:ComboBox id="seleccion" dataProvider="{data.opciones}" labelField="label" labelFunction="funcionLabelComboBox"                                                   styleName="comboOpcionDetallePlato"  change="dispatchEvent(new Event('cambioOpcion',true))"/>
                        <mx:Script>
                            <![CDATA[
                                public function funcionLabelComboBox(item:Object):String {
                                        return item.label + ", $" + item.precio;
                            ]]>
                        </mx:Script>
                    </mx:VBox>               
                </mx:Component>
            </mx:itemRenderer>
    So what I whant to access, is every Component that the itemRenderer created:
    Alert.show(((catalogoOpciones.dataProvider.getItemAt(0) as VBox).getChildByName("seleccion") as ComboBox).selectedIndex.toString());
    I want to get the selectedIndex of the ComboBox of the First Item that was created on the  HorizontalList. I thought the last line of code would do the trick but it doesn't. Could you be more specific please?
    Thanks again
    Sebastián Toro O.
    PS:don't worry that if you answer my question you'll get the 10 pts

  • I-tunes is note letting me access i-tunes store without first dowloading the new version of i-tunes. The problem is that my older operating system won't work and is not allowing the newer i-tune versions to work.  How can I just get use the old i-tunes?

    I-tunes is note letting me access i-tunes store without first dowloading the new version of i-tunes. The problem is that my older operating system won't work and is not allowing the newer i-tune versions to work.  How can I just get use the old i-tunes?

    Hi,
    Not sure if any of you above have managed to solve your problem or not but after coming across this same problem myself today as I am currently 'sofa bound' I decided to make it my mission to find a way around it.
    Initially I did think, having ready what seemed like a million questions and people with the same problem, that the only way was to buy OS X 10.5 ... HOWEVER, no. In among all these threads I found a jewel - Download I Tunes 9.2.1 which gets rid of the download itunes 10 advert and allows you to then buy from itunes again :-)  I am now one very happy lady.
    I apologise to all those that dont have older versions of OS X that maybe wont support even this upgrade but certainly for those like me with just 4yr old lap tops at least it means it not longer means buying a new one.
    Hope this helps son very frustrated people like myself - so much for apple support!

Maybe you are looking for

  • Input source

    Hi, I got new "pages" for macbook pro with maverics OS. It seems it's missing half of what there was in previous version. I need to use DEVANAGARI QWERTY input and it's not there. I also use diacritics and previously I had English Pro, of course not

  • Using all memory, including virtual memory

    For some reason Final Cut Pro 10.0.3 doesn't get past the loading screen, it's worked fine until yesterday - havent done any system updates, or program upgrades.  When I start the program, I can see the square that says FCP, and I can see the interfa

  • Computer freezes and I think it's because of the soundca

    Hey Guys, I have a Dell XPS Gen 3: 3.6 ghz HT 024MB RAM ATI RADEON X800XT Audigy 2 (plain) WinXP Home, SP DirectX 9c Whenever I play a game that utilizes EAX processing (Far Cry, Thief Deadly Shadows) after about 30 minutes the screen freezes, then g

  • How to check connectivity of OCFS2 nodes?

    Hi, I was trying to setup OCFS2 over ISCSI on OVM server 2.3. By a mistake I didn't setup iptable of one node correctly, however, "service o2cb status" reported everything well on each node. I was wondering if there are any tools can detect such issu

  • Text Edit Tool icon missing in Acrobat Standard X

    Hi, In Acrobat 8 Standard, when I click "Text Edit Tool" icon, I can start insert, delete or replce text comments without re-click any  "insert", "delete" or "replace" icon in the Text Edit Tool until I press"Esc" key.  I just install Acrobat Standar