Question about cutom tag jars on Tomcat

I have written a custom tag for data connection in Java and wrote a TLD to use it. My problem is a I have three applications that all use it, so I put the jar file in my CATALINA_HOME/common/lib and the tld finds the jar but the jar has a properties file it uses to get the DB name and user names. The jar can not find the properties file, I tried putting it in the common/lib/, I put it in the common/ and I also tried in the APP_DIR/WEB-INF/ and it still can not find them. Is there a place I can put the properties file that tomcat will have it available for the jar file.
Thanks in advance

Put the properties file inside the jar file. Then you can load it from your code using the classloader. Lets say you put the properties file in a subdirectory "props" inside the jar, you can then load it using this code:
InputStream is = this.getClass().getClassLoader().getResourceAsStream("props/db.properties");
Properties props = new Properties();
props.load(is);
is.close();Assuming you name your file "db.properties" of course.

Similar Messages

  • Question about Id3-tags and song managem

    Hello, I am getting ready to buy a Zen Touch 20GB in a couple of weeks and I have a few questions about the management software.
    (Correct me if I am wrong about something)
    ) Are songs organized into groups by Genre instead of just folders like on the Ipod?
    2) Are Id3-tags used instead of filename for identification?
    3) What parts of the tag are needed besides title and artist?
    4) Which version of tags does the Zen Touch recognize: Version or Version 2?
    5) If I edit my tags using an external program such as Id3-TagIT, will the tags carry over to the Creative software and to the player?
    Thanks a lot for your help. I want to make sure I have my music collection in order before I get my Zen Touch.

    euph_jay wrote:Ok, so lets say I have all my music in folders right now seperated into different categories on my hard dri've. Some folders denote the artist, some the album, and some a genre. Example: Folder: Chicago Contents: Chicago .mp3 files Folder: Techno Contents: various Techno artist's songs What is the best way of organizing my folder system, so that the transition will be easy to the player?
    Folders are pretty much irrelevant. What the software will do is look at the *tags* in the files and then use these to build the player's library.
    Will imbedded folders work on the player? (like Techno->Crystal Method->Cystal Method .mp3's)
    Again the player has no concept of folders, although if you set Techno as a Genre tag you will be able to view via this in the Music Library.
    Or, am I misunderstanding how music is stored into the mp3 player. Instead of storing music in a "folder like" system (like the Chicago folder or Techno folder), does it store all the songs individually on the device? Then you have to sort it by artist, album, or genre?
    Using your example, in the Music Library you have essentially three categories: Album, Artist, and Genre. So under Album you would see "Vegas" (the Crystal Method's album), under Artist you would see "The Crystal Method", and under Genre you would see "Techno" (and then either the album or artist under this... I forget which it is offhand).
    Make sense?

  • Some question about sqlserver2008 sqljdbc4.jar

    hi,thank for read.
    I have a question about  sqljdbc4j.jar's PreparedStatement class.
    When i use PreparedStatement to deal a 'like ? ' query , like this sql (select * from(select ROW_NUMBER() Over(order by id) as rownum,* from t_word ) t where 1=1 and name like ?)
    then i set the like param for '%param%' or '%param' or '%param' , the program return
    different results, why ?
    Is there other way to deal this problem?
    Thanks again for the reading. And I hope to get your asap

    Hello,
    WHERE title LIKE '%param%' will return all name with the word 'param' anywhere in the name; '%param' will return names end with "param";'param%' with return start with "param".
    Referece:
    LIKE (Transact-SQL)
    Regards,
    Fanny Liu
    Fanny Liu
    TechNet Community Support

  • Noob question about DIV tags

    Learning DW and CSS so patience is in order .
    I've being reading numerous posts here and on the web about avoiding tables for laying out web pages. I can see the advantages in terms of cleaner codes and easiness of updating and changing sites at a later time. So I started learning about DIV tags (although tables is very easy for me) and have practice a few times with fairly good results, love the absolute positioning with it. Having said that, for the love of me, can't find a way of centering horizontally a page designed with DIV tags (due to ignorance), for example, 1 column/three rows page, after defining styles, size and colors I enclosed everything in another DIV tag, wrapper I think is called, but have not found a way of centering it on the page, text-aligment on the DIV tag only centers the text not the DIV itself, how to go about this? Help is appreciated.

    love the absolute positioning with it.
    Get over it.  It's a trojan horse.  Absolute positioning is not a general layout method.
    To center ANY block (non-absolutely positioned) element, use CSS to give it a width and left/right margins of 'auto'.  For example -
    <div id="foo">...</div>
    That div will be centered with this CSS -
    #foo { width:300px; margin:0 auto; }
    I think you are on the wrong path already, though.  Stick with tables (which you say are very easy for you) UNTIL you a) understand CSS well enough to understand what absolute positioning is and why I say it's bad, and b) understand how to use float, margin, and padding to place things on the page.  Then you are ready to move away from tables.

  • Question about Java Applet Jar file signing.

    These questions pertain to Java 6 Standard Edition 1.6.0_22-b04 and later.
    I have gone through the Oracle Java Tutorial for generate public and private key information
    to sign a jar file, and how to sign the jar itself, all at
    [http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html|http://java.sun.com/developer/onlineTraining/Programming/JDCBook/signed.html]
    , and seek some clarification on the following related questions:
    -In order to "escape" the java applet sandbox that exists around the client's
    copy of the applet running in their web browser, ie.
    (something forbidden by default), is verification of the signed applet enough, or is a policy file required
    to stipulate these details?
    -using the policytool policy file generator, what do I need to add under "Principals"
    (if anything) when dealing with a Java applet? Are Codebase and SignedBy simply author information?
    -If I choose to use a java.security.Permission subclass object set up in equivalent fashion within the Applet,
    which class within the Applet jar do I instantiate that object in? Does it need to be mentioned
    in the applet's jar Manifest.MF file?
    -Is the "keystore database" a java language service/process which runs in
    the Server's memory and is simply accessed and started by default
    by the client verifier program (appletview/web browser)?
    -The public key certificate file (*.cer) is put in the webserver directory holding
    the Applet jar file (ie. Apache Tomcat, for example).
    -Presumably, the web browser detects the signed jar
    and certificate file, and provides the browser pop up menu asking the user
    about a new, non recognised certificate (initially).
    Is this so?
    -With this being the case, can the applet now escape
    the sandbox, be it with or without the stipulated
    policy permissions?

    848439 wrote:
    -In order to "escape" the java applet sandbox that exists around the client's
    copy of the applet running in their web browser, ie.
    (something forbidden by default), is verification of the signed applet enough, or is a policy file required
    to stipulate these details?Just sign the applet, the policy file is not necessary.
    -Is the "keystore database" a java language service/process which runs in
    the Server's memory and is simply accessed and started by default
    by the client verifier program (appletview/web browser)?No.
    -The public key certificate file (*.cer) is put in the webserver directory holding
    the Applet jar file (ie. Apache Tomcat, for example).No. For a signed Jar, all the information is contained inside the Jar.
    -Presumably, the web browser detects the signed jar
    and certificate file, and provides the browser pop up menu asking the user
    about a new, non recognised certificate (initially).
    Is this so?No. It is the JVM that determines when to pop the confirmation dialog.
    -With this being the case, can the applet now escape
    the sandbox, ..Assuming the end-user OK's the trust prompt, yes.
    ..be it with or without the stipulated
    policy permissions?Huh?

  • Question about id3 tags

    i had all of the fields of all my songs just how i liked them. i thought itunes had written everything i had edited into the id3 tags of all the songs. apparently, it didn't work.
    i am using another software called serato. i took the mp3's whose tags i edited in itunes and imported them into serato. i know this program is able to read all versions of tags, so i found a suggestion someone made to strip the id3 tags. this process called for selecting all the songs, converting the id3 tags to "none", then changing them back to a certain version (v2.3 or v2.4).
    after doing this, i take a look at my itunes library and about 80% of all my songs have their tags messed up. either the genre is back to what it was before i changed it a while ago, or (more annoyingly) the song titles are all truncated to a certain length.
    1. is there any way to undo this? or am i going to have to manually go back and re-edit all the fields?
    2. is there a better way of ensuring itunes is correctly changing the id3 tag fields? for example. if i edit the id3 tags on itunes on one profile on my mac, then take the same mp3 file and import it into itunes on another profile, the id3 tags seem to not have been changed at all.
    help anyone? this whole thing has got me really frustrated. thanks in advance.

    In Serato setup, check box Read iTunes Library. However this doesn't solve the problem, only creates yet another location for cleaning up....
    Having somewhat same issue: Converted all id3 from iTunes succesfully, but couldn't import files correct on other macbook in iTunes (same version)?!?!? Doesn't read id3...

  • Simple question about custom tags really easy!!

    I am trying to make my own custom tags, so far i have created simple one that have i use for heading or to set the page layout for a jsp page, My question is I want to make a custom tag with a body , with a start and end tag can anybody give a simple example of a custom tag which has a body.
    I do not mean write me a tag i mean what could a tag with a body be used for? Can you give me some example of what a tag of this kind could do?

    Thanks having read that and some other pages i have another question:
    would it be possible to put the following code into a custom tag so that i can pass in a list and have it output it to a table?
    <TABLE >
    <% 
    out.println("<TABLE >\n" +
                    "<TR BGCOLOR=\"#FFDDAA\">\n" +
                    "  <TH>ID Number\n" +
                    "  <TH>Artist\n"
    Iterator it = pricePassed.getpricePassed().iterator();
    while( it.hasNext() ){
       MySite.VideoBean vids = (MySite.VideoBean) it.next();
       out.println( "<TR>\n" +
                   "<TD><Center><B>" + vids.getRecId() + "</TD>" +
                    "<TD><Center><B>" + vids.getArtist() + "</TD>"
    </TD></TR>\n" );
    %></TABLE>At the moment i use the above in a jsp to put data into a table, would it be a massive task to undertake to put into a custom tag?

  • Question about classpath and jar file

    I have a jar file (actually jhall.jar, the java help jar file). How do I uses its classes if I don't want to add it to the classpath. Currently, I have the jar file in the same directory as all my other classes.

    it simply adds secondjar.jar into firstjar.jar, rather
    than extracting secondjar.jar's files and put it into
    firstjar.jar. How would I be able to do that?Don't do either of them. Distribute the two jar files separately, and in the manifest of the one which is meant to be your executable jar file, put a Class-Path: entry that refers to the other one. Look at the latter parts of the tutorial about jar files:
    http://java.sun.com/docs/books/tutorial/jar/basics/
    PC&#178;

  • Help with a question about making/running .jar files.

    First i have a question, can i make a .jar file that can run on a computer without JRE installed. And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearchAnd im using the command:
    jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

    dford425 wrote:
    First i have a question, can i make a .jar file that can run on a computer without JRE installed. No, not unless you package the JRE with your dist. Hence the name JRE (Java Runtime Environment).
    And if i can, how do i make it. I have tried to make it on my computer, that has JRE but i keep getting the error when i run it: Exception in thread "main" java.lang.NoClassDefFoundError: Sample\FileSearch
    That simply means your not pointing the runtime to the classes. Set your CLASSPATH environment variable correctly and it will run (given you have a JRE which it appears you do).
    And im using the command:
    jar cvfm jarname.jar directory\manifest.txt directory\FileSearch.class directory\FileNode.classIt says it creates the .jar but is unable to run it.

  • A question about keyword tags

    Is it possible in settings... or somewhere, to set it so that when you open (PrE9's) organizer instead of starting with keyword hierarchy list - it could open on keyword cloud view? I am not so keen on the hierrarchy method...
    Thanks.
    brush

    I did some experimenting in the Elements 9 Organizer.
    1-- yes, when you close the Organizer then it does always seem to come up next time with the Thumbnail grid AND the Tags panel on the right is set to Hierarchy view. Then you must click on the icon for Cloud view.
    2-- my conclusion is that if I click on the Cloud icon after starting the Organizer, then it was staying as Cloud in the Keyword Tags panel to the right of the Thumbnails for the duration that the Organizer is open.
    3-- Note that if you use Full Screen for viewing your photos, then for the "Quick Organize" panel that drags out from the left side of the screen near the bottom, the default for Keyword Tags is Cloud. This is a different method of working which you may or may not like: however since it does set Cloud I decided to mention it.
    FYI - to get to Full Screen you can use the pull down menu for the Display icon (that is next to the House icon on the top bar of the main Organizer screen). Choose the option "View, Edit, Organize in Full Screen".  FYI - I usually select the thumbnails of the photos which I want to Organize before I go in to Full Screen.

  • Quick question about div tags

    How do you make a div tag only as wide as the content that is
    inside of it, rather than the width of the cell that surrounds
    it?

    <div style="width:200px; float:left">
    Would give you a div 200px wide and floated to the left. You
    can similarly
    float another div to the right of this div etc. When you are
    done with a row
    of divs, you would want to clear the float so that the next
    set of divs
    starts with the extreme left as the reference point. To clear
    a float you
    would use style="clear:both;" or style="clear:left;" etc.
    Please do some
    reading on all this before you start experimenting else
    you'll run into a
    multitude of issues.
    You cannot lose until you give up !!!
    "AngryCloud" <[email protected]> wrote in
    message
    news:f133f2$jk4$[email protected]..
    > How do you make a div tag only as wide as the content
    that is inside of
    > it, rather than the width of the cell that surrounds it?

  • Question about adding tags to images and music

    Hi I have an artist page online and I have read that adding meta tags to your page does absolutely nothing to help search engines these days and then someone recommended adding tags to the images on my site using aperture (which I cant afford) so can anyone explain if I can do this in iphoto or photoshop? and also can I add tags to the mp3's available on my site to better perform in search engine searches? can i do this with itunes?
    Thanks in advance

    The search engines have to be lead to your music/photo page using an appropriate URL and having a text description with as many relevant "key" words as possible.
    Also, you need as many links to this page as possible from other sites as well as your own pages.
    When I enter one of my own song titles and name into Google, all the top listed links are sites that sell digital downloads and CDs. Have a look at the way these sites list your music to see the most effective way of doing it on your own website.
    Obviously, you first have to add your URL to Google, Yahoo etc and get them to verify your sitemap.

  • Question about Hidden Tags

    I have two forms Page1.jsp and Page2.jsp
    when i invoke page1.jsp i pass a customer id to it ... the actionclass gets it and displays Page 1.jsp
    now when i click on Page 1.jsp i need to pass the same id to Page 2.jsp's Action class
    How do i do it
    Is it possible using <html:hidden> tag
    Thanks
    ~K

    that's certainly 1 way to do it, sure.

  • Question about jsp tags

    Hello to all the programmers ,
    I have the code below , i get from servlet the attribute that called carList and then i use the forEach iterator for
    view the list of employees.
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <html>
    <head><title>The list of the Employees</title></head>
    <body>
      <table>
         <tr>
           <th bgcolor="cccccc">EMP_ID</th>
           <th bgcolor="cccccc">FIRST_NAME</th>
           <th bgcolor="cccccc">LAST_NAME</th>
         </tr>
      <c:forEach items='${empList}' var='emp' >
        <tr>
        <td>${emp.id }</td>
        <td>${emp.first_name}</td>
        <td>${emp.last_name}</td>
        </tr>
      </c:forEach>
      </table>
    </body>
    </html>The result that i get us :
    EMP_ID FIRST_NAME LAST_NAME
    ${emp.id} ${emp.first_name} ${emp.last_name}
    with the suitable headers of course.
    Why i get this result and not get as i expected the empBean.
    Regards
    Ofer

    I checked the web.xml and version is 2.4.
    I don't thhink that problem related to the web.xml , because i have another example that worked like this one :
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%
        // DON'T FREAK OUT!!! This scriptlet code will go away once
        // we have a model and controller in place...
        String[  ][  ] empList = {
                {"22254", "Joe", "Pashi"},
                {"15487", "Yos", "Alke"},
                {"8777", "Jhon", "Gatez"}
        pageContext.setAttribute("empList", empList);
    %>
    <html>
    <body>
      <table border="1">
        <tr>
          <th bgcolor="cccccc" align="left">Id</th>
          <th bgcolor="cccccc" align="left">First_Name</th>
          <th bgcolor="cccccc" align="left">Last_Name</th>
        </tr>
        <c:forEach items='${empList}' var='emp'>
          <tr>
          <td align="left">${emp[0]}</td>
          <td align="left">${emp[1]}</td>
          <td align="left">${emp[2]}</td>
          </tr>
        </c:forEach>
      </table>
    </body>
    </html>when i run this jsp page in tomcat i get the this result as expected :
    Id First_Name Last_Name
    22254 Joe Pashi
    15487 Yos Alke
    8777 Jhon Gatez
    I think that maybe i missed something in the previous example , something that related to the iterator forEach.
    I try to do the same thing but get the array of the employee from the servlet that's all , i see that the arrayList of the employees is created and i assign as an attribute.

  • Question about custom tags

    Hi All,
    Please tell me what is differnce between javabean and custom tags.
    thank you.

    Javabean is a data object (or a data holder) whose properties can be accessed using getters, setters - ex getName() and setName()
    JSP custom tags are merely Java classes that implement special interfaces (Tag interface). Once they are developed and deployed, their actions can be called from your HTML using XML syntax. Refer the article http://java.sun.com/developer/technicalArticles/xml/WebAppDev3/
    Cheers,
    Janesh

Maybe you are looking for

  • How do I only put selected iPad Pages docs onto iCloud?

    I am using the latest Pages app on my iPad2.  I want to only put certain documents from Pages into iCloud.  I want to do the same with Numbers and Keynote.  In other words, I want to decide what does and does not go onto iCloud.  Is there a way to do

  • Active Directory Web Services service terminated unexpectedly

    Hi everyone: I'm having a problem with the Active Directory Web Services service does not start. Attach the event ID: Log System: Log Name: System Source: Service Control Manager Date: 1/6/2015 6:55:19 PM Event ID: 7034 Task Category: None Level: Err

  • Timed out trying to start process P045

    HI, we have 2 node rac on ibm aix . we got " Timed out trying to start process P045 " alert log of on node 1. pl explain what does this mean ?

  • Retention Money Senario

    Dear all, my client required retention money senario? e.g.: customer placing a order with condition that 10% retention money as a payement terms. Like if i sold 100 rs material in that case he gives me only 90 rs and 10 rs as a retention money for on

  • How to properly build a grouped ListView for Win 8.1 and future versions?

    Hi, I am porting a Windows Phone 8 app to Windows 8.1 and trying to create a grouped list of items using a ListView. After several hours of trying and reading the ListView documentation I am totally confused and still have no idea of how to correctly