Moving config stuff from myapp.conf in web.xml

Hi guys,
I made a web application myapp, which parse and read its config stuff from a text file called myapp.conf (a httpd.conf like file). I want to move all this config stuff in web.xml of my application (webapps/myapp/WEB-INF/web.xml).
Can I do this?
How can I read a tag with it's name, value, etc from web.xml?
I put some env-entry tags in my web.xml but I don't know how to access them. Can you point me to some examples of doiing this?
Thanks,
bufny

Hi,
I can help u for the tomcat4.0 servlet engine:
1)open the server.xml file availavle in the tomcat_home\
config\ In that u add the context and can add the additional resource which can be later accessed from the jndi.Please refer the default file.
2)then create the directory specified in the
<context docbase="u r directory path" >
resource can be added here
</context>
3) within that directory create the following structure:
ur_dir\web-inf
ur_dir\ web-inf\web.xml
within the web-inf u specify something like this(Please refer default file)
<res-ref-name>jdbc/demo</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
4)Then from ur jsp application within the same context
call the usage as
Context initCtx = new InitialContext();
Context envCtx = (Context)initCtx.lookup("java:comp/env");
DataSource d=(DataSource)envCtx.lookup("jdbc/demo");
5)Similarly other objects can be accesses but need to be defined in the web.xml file (deploymentdescriptor)
Hope u get some idea
regards vicky

Similar Messages

  • I used to have AVG free antivirus software on my computer. I uninstalled it, but every time I open Firefox and do a search, it comes up with AVG Secure Search results. I have tried the about:config stuff from the forums, but it is to no avail.

    Had AVG free version. After Firefox updated to the newest version, AVG Secure Search results are the default. I have researched the issue for the past 3 days and have tried every option available on forums, etc. Nothing seems to work. This is very annoying and I'm about ready to switch to google chrome.

    I ended up finding a solution.....went to Firefox tab on top left of browser screen. Went to help, restart with add-ons disabled. This takes you to the Firefox Safe Mode text box. Select "Reset all user preferences to Firefox defaults. This seems to have worked, as there is no longer an AVG Secure Search directed screen. Also, I installed Avast. Have had it on my tower PC and another laptop for 2 years with no issue. Screw AVG!!!

  • ejb-name into web.xml automatically

    Hello all,
    I follow the OC4J's tutorial in >>Servlet Developer's Guide<< using Jdeveloper 903.
    there is an EJB session bean named HelloBean.
    From UML Diagram, I can get it, and write the HelloServlet.java to invoke session bean.
    now it is Ok. Jdeveloper online help says that EJB reference <ejb-ref> can be written into web.xml file,
    but it doesn't do it. I manually insert <ejb-ref>...</ejb-ref> into web.xml.
    and change <ejb-name> and <ejb-ref-name> in ejb/HelloBean.
    I want to know how to do this automatically by Jdeveloper 903.
    and how to change session bean's <ejb-name> from HelloBean into ejb/HelloBean?
    Thanks.
    Wu JianHua.

    Automatic insertion of ejb-ref in web.xml whenever EJB dependencies are included in WAR deployment profile.
    Select Tools | Preferences
    Select Deployment in the left hand tree
    Select the check box for "Automatically Fill in <ejb-ref> elements in web.xml
    You can hit F1 hel on the above panel to view the help.
    From help system
    Automatically Fill In <ejb-ref> Elements in web.xmlBy default, JDeveloper automatically inserts corresponding elements to the web module deployment descriptor file, web.xml, whenever EJB dependencies are included in the WAR profile. If an EJB dependency is subsequently removed, however, JDeveloper will leave the elements in web.xml instead of removing them. Clear this checkbox to disable automatic insertion of elements in the web.xml file. Clearing this field prevents extraneous <ejb-ref> elements from appearing in the web.xml. However, do this with caution, since you'll have to make sure that the web.xml file is complete and accurate before deployment.
    raghu
    JDev Team

  • Moving stuff from one JList to an other

    Hi,
    I'm trying to develop a JPanel with two JLists and two arrow JButtons to be able to move (!) stuff from the left JList to the Right and backwards. Both JLists have a ListCellRenderer that extend JLabel.
    Managed to do a 'copy' of selected values to the other JList,
    eg.
    public void addKeyWords(java.awt.event.ActionEvent actionEvent,javax.swing.JList allKeyWords,javax.swing.JList chosenKeyWords) {
    java.util.List chosenValues = java.util.Arrays.asList(chosenKeyWords.getSelectedValues());
    java.util.List selectedValues = java.util.Arrays.asList(allKeyWords.getSelectedValues());
    java.util.Set set = new java.util.HashSet();
    set.addAll(selectedValues);
    javax.swing.JList l = new javax.swing.JList(set.toArray());
    getChosenKeyWordsList().setModel(l.getModel());
    return;
    but can't figure out how to get stuff to disappear in the first JList when it is moved to the other JList nore how to enable the user to 'add' elements one at a time.
    Enyone?

    hi.
    what i do when i want to remove from the right side list:
    //get an array of indexes that needs to be removed.
    elements[] removedItems = getStrings(rightListData, selected);
    //copy all elements that do NOT need to be removed
    rightListData = utils.copyArrayWithoutIndex(rightData, selected);
    rightList.setListData(rightListData);
    same goes for left side.
    basically, i remove all selected elements from the array of rows, and re-set the list data model.
    HTH.

  • I moved my itunes from a pc to a mac. only my music was transferred, how do i make the mac my main itunes so the rest of my stuff transfers?

    i moved my itunes from a pc to a mac. only my music was transferred, how do i make the mac my main itunes so the rest of my stuff transfers?

    Don't understand?
    There is no "main" itunes.
    Your "stuff" will be wherever you put it.
    Copy it from wherever it is now to wherever it is that you want it.
    Perhpas if you explain, more help can be given.

  • New PC user needs help moving stuff from MAC

    I have just had to resort to getting a PC and I don't know how to get all my stuff from my mac to my PC. Specifically; iPhoto library, itunes folder, mailboxes and signatures in Mail, bookmarks in firefox or safari, 'address book' v cards, and all my textedit docs (AAARRRGGHHHH!).
    Can anyone help me? My new PC is a Quad core acer running vista.

    Apple devices are designed to only allow you to sync to one itunes library at a time. If you try, it will replace everything on the deivce with the itunes library you are syncing to.
    If she has already synced her ipad to another computer, then this is normal behavior.
    It would be best to create a library just for her. If you can import/export the music and photos on the computer into her own itunes library.
    Syncing multiple devices with one computer
    http://support.apple.com/kb/HT1495
    The reason that content from her ipad is showing up on your iphone is probably due to you both sharing the same apple id and having automatic downloads turned on in the settings.
    You can turn this off by going to settings/itunes and app stores/automatic downloads/turn off

  • Env-entry from web.xml not in generated plan.xml

    Hello,
    Recently I migrated a JDeveloper 10.1.3.4 project to 11.1.1.3 and from there to 11.1.2.4. When I deploy this project to an 10.3.5. weblogic server then the 'env-entry' entires in the web.xml are not available on the application server.
    Even when i use weblogic.PlanGenerator with the -all option to create a plan.xml from the WAR-file the env-enties are not found.
    The web.xml is like this:
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <listener>
    <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>jaxrpc</servlet-name>
    <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>VersionServlet</servlet-name>
    <servlet-class>nl.deltalloyd.alfa.keten.version.VersionServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>VersionServlet</servlet-name>
    <url-pattern>/version</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>jaxrpc</servlet-name>
    <url-pattern>/RelatieSoapHttpPort</url-pattern>
    </servlet-mapping>
    <jsp-config/>
    <security-role>
    <role-name>Administrators</role-name>
    </security-role>
    <resource-ref>
    <res-ref-name>jdbc/AlfaDS</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <env-entry>
    <env-entry-name>appl/version</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>2013.06</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>appl/releasedate</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>13-06-2013</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>appl/loglevel</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>INFO</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>appl/omgeving</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    <env-entry>
    <env-entry-name>service/case</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>http://test.services.intranet.company.nl/GixoCaseWeb/services/CaseServiceHttp</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>mqueue/rc/host</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>nl001wwavm058.ad.intra</env-entry-value>
    </env-entry>
    <env-entry>
    <env-entry-name>mqueue/rc/port</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>1414</env-entry-value>
    </env-entry>
    </web-app>
    Maybe I missed something in the migration path. Can someone please help me.
    With kind regard,
    Martin

    Let me describe my case in few more words...
    I have some kind of client-server app. Clients have OC4J installed and they download myApp.ear and myApp_plan.dat files and by using script (Windows CMD batch file) clients install those files with admin_client.jar, OC4J's admin utility. The problem is that I have 2 different types of clients and I have client specific settings set in web.xml file and each time I compile myApp.ear I have to uncomment/comment some lines in web.xml.
    So, to make a long story short, I need a way to deploy those settings separated from (outside of) myApp.ear. By following you link, I have read that orion-web.xml should reside inside WEB-INF folder of myApp.ear, which is not good for me.

  • I want to remove the COnlineBank, OnlineBank and csample applications from my application and web server.

    How can I safely do this on Solaris? I've tried "iasdeploy removeapp" and "iasdeploy removemodule" with no luck. I want to clear all of this demo stuff out to make both the web and app server look more production like.
    Thanks
    Eric

    Eric,
    these applications are applogics which are not controlled by the
    iasdeploy tool. Unfortunately, there is no tool available to remove
    these applications for you. What you can do is to manually remove all
    their entries, but be careful if you do that. If you remove the wrong
    keys you might break your ias installation, so be warned and make sure
    you backup the whole ias registry before attempting to remove anything.
    Eric Coleman wrote:
    >
    I want to remove the COnlineBank, OnlineBank and csample applications
    from my application and web server.
    How can I safely do this on Solaris? I've tried "iasdeploy removeapp"
    and "iasdeploy removemodule" with no luck. I want to clear all of
    this demo stuff out to make both the web and app server look more
    production like.
    Thanks
    Eric
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!--
    Han-Dat Luc ([email protected])
    Senior Consultant
    SUN Professional Services (iPlanet)
    o .
    o .
    O _ ____ _ _
    (_) _ \| | __ _ _ __ ___| |_ TM
    | | |_) | |/ _` | '_ \ / _ \ __|
    | | __/| | (_| | | | | __/ |_
    |_|_| |_|\__,_|_| |_|\___|\__|
    e-commerce solutions
    Sun Microsystems Australia Pty Ltd

  • Need help to set values from web.xml in a jsp class

    Hey :-)
    I`m trying to get value from my web.xml file into a jsp class. The problem is that the value always retur null. My web.xml file is replaced in the WEB-INF directory where should be. Here is my web.xml
    <servlet>
    <servlet-name>Html</servlet-name>
    <servlet-class>Html</servlet-class>
    <init-param>
    <param-name>html_test</param-name>
    <param-value>Value I want have in my jsp class
    </param-value>
    </init-param>
    </servlet>
    And her i my java class who don`t work:
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    import javax.servlet.ServletConfig;
    public class Html extends BodyTagSupport
    String title="";
    String html_test;
    ServletConfig config;
    public void doInitBody() throws JspException
    html_test = config.getInitParameter("html_test");
    }//End of method doInitBody()
    public int doStartTag() throws JspException
    try
    JspWriter out = pageContext.getOut();
    out.print( "<HTML>\n" );
    out.print( "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" );
    out.print( "<BODY>\n" );
    out.print( "<BR><H1>" + html_test + "</H1>" );
    And here are my html_test variable return null.
    I hope somone can help me, duke dollars will be given away for the solution answer.
    paulsep

    Nothing seems to work, have change the string and rewritten the web.xml file to:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
              <context-param>
                   <param-name>html_test</param-name>
                   <param-value>Value I want have in my jsp class</param-value>
              </context-param>
    </web-app>

  • How can I get the context-parm from a web.xml file using struts?

    Hello:
    I need get the context-param from the web.xml file of my web project using struts. I want configurate the jdbc datasource connection pooling here. For example:
    <context-param>
    <param-name>datasource</param-name>
    <param-value>jdbc/formacion</param-value>
    <description>Jdbc datasource</description>
    </context-param>
    and then from any Action class get this parameter.
    Similar using a simple server can be:
    /** Initiates new XServlet */
    public void init(ServletConfig config) throws ServletException {
              for (Enumeration e = config.getInitParameterNames(); e.hasMoreElements();) {
                   System.out.println(e.nextElement());
              super.init(config);
              String str = config.getInitParameter("datasource");
              System.out.println(str);
         public void doPost(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException {
              // res.setContentType( );
              System.out.println("Got post request in XServlet");
              PrintWriter out = res.getWriter();
              out.println("nada");
              out.flush();
              out.close();
    but only this works for init-params, if I use
    <servlet>
         <servlet-name>MyServlet</servlet-name>
         <display-name>MyServlet</display-name>
         <servlet-class>myExamples.servlet.MyServlet</servlet-class>
         <init-param>
         <param-name>datasource</param-name>
         <param-value>jdbc/formacion</param-value>
    </init-param>
    </servlet>
    inside my web.xml. I need something similar, but using struts inside the action class for that I can get the context-params and call my database.
    Thank you

    To get context parameters from your web.xml file you can simply get the ActionServlet object from an implementing action object class. In the perform (or execute) method make the following call.
    ServletContext context = getServlet().getServletContext();
    String tempContextVar =
    context.getInitParameter("<your context param >");

  • To access pdf files from application server using web.show_document

    Hello!
    If my pdf file is copied in Oracle_home/forms90/java directory.Then using web.show_document i can access the pdf file.But I can't copy all the pdf files in /forms90/java directory.We have lacs of pdf files which I want to keep in my own directory.But my requirement is if my pdf file is in /home2/docs directory in (Linux application server) ie in my own directory where I store all the pdf files.Then web.show_document does not open the pdf file.It says page cannot be displayed.For that I think we have to configure the directory /home2/docs directory as a webserver.From otn I got something like forms90.conf file in application server where we have to set virtual directory mapping etc.If the pdf is in local machine then in orion-web.xml file we have to mention real path and save the file and shutdown oc4j instance and restart it again.I tried it.But it is not working.Can u give me step by step instructions to solve this problem.I found a few links in discussion forum.But is doesn't work out.My pdf file is in /home2/docs directory in Linux application server.Please treat it as urgent.
    Regards
    Jayashree

    Hi Sandeepmsandy,
    There is no available code sample for this scenario. You may write your own.
    Step 1: Get pdf URL from sqlite database. Please refer to the following MSDN blog and see a code sample.
    http://blogs.msdn.com/b/robertgreen/archive/2012/11/13/using-sqlite-in-windows-store-apps.aspx. Note, you need to retarget the project to 8.1 and then get two sqlite packages from NuGet before building this sample.
    Step 2: Use some special classes to get file from serer.
    HttpWebRequest can help download small pdf files. For more information to see
    https://social.msdn.microsoft.com/Forums/windowsapps/en-US/de96a61c-e089-4595-8349-612be5d23ee6/download-file-with-httpwebrequest?forum=winappswithcsharp. It’s easy for use, but if you want to download the larger or many files, it’s recommend to use
    BackgroundTransfer namespace. The classes in this namespace provide a power way to transfer files in the background. See a code sample from MSND.
    https://code.msdn.microsoft.com/windowsapps/Background-Transfer-Sample-d7833f61.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • Moving itunes lib. from old pc to new mac

    i recently got a new mac but can't figure out to transfer my music over. i have all my songs on an ipod and also on the pc i was using before. i tried connecting the ipod and enabling disk use and then downloading a music transfer software, but that didn't work. any helpful strategies out there? thanks!

    There's a manual method of copying songs from your iPod to your Mac at this link: Two-way Street: Moving Music Off the iPod
    There is a good general guide to switching from Windows to Mac at the following link that touches on moving music as well:
    How to Move to a Mac - Get your stuff from your PC to your new Mac
    There are also these guides:
    How to move music between authorised computers
    Networking with a Windows PC

  • Web.xml + jsp-config element missing in definition?

    Hi,
    I have problem with jsp-config element definition in web.xml - I checked web-app_2_5.xsd it's reffering to javaee_5.xsd - but it's missing there
    from web xsd:
    <xsd:element name="jsp-config"
              type="javaee:jsp-configType"/>
    There is no javaee:jsp-configType. Is jsp-config deprecated? I couldnt find it in 1.4 as well. Please advice.
    Thanks
    Y

    ok - there are includes in web-add_2_5.xsd to jsp_2_1.xsd ... missed that - sorry
    <xsd:include schemaLocation="javaee_5.xsd"/>
    <xsd:include schemaLocation="jsp_2_1.xsd"/>
    Y

  • Moving Apps-Tier from One Server to Another Server

    Hello -
    Please find details below
    We are on R12.1.3 and details
    Datbase Version : 11.2.0.3
    E-Business Version : 12.1.3
    Operating System : Solaris 10 on both servers A & B
    Source Server Details : Server A
    Source Instance : Single Tier
    User : Oracle
    Tier : DB
    User : Applmgr
    Tier : Apps
    Application Tier : Concurrent / Forms / Web / Others
    Our Goal is to moving Apps-Tier from Server A to Server B
    Steps we followed as part of this :
    1. Shutdown apps-Tier services on Server A
    2. Ran adpreclone.pl on apps-Tier on Server A
    3, Copy apps-Tier files from Server A to Server B
    4. Ran adcfgclone.pl appsTier on Server B
    5, perl adaddnode.pl on Server B
    By Following above steps we are not able to bring up concurrent managers.
    Please suggest us if we are doing anything wrong.
    Regards
    VSH

    By Following above steps we are not able to bring up concurrent managers.What is the error you get when you start the CM? Any errors in the CM log file?
    Please run cmclean.sql and ccm.sql as per these docs.
    Concurrent Processing - CMCLEAN.SQL - Non Destructive Script to Clean Concurrent Manager Tables [ID 134007.1
    Concurrent Processing - CCM.sql Diagnostic Script to Diagnose Common Concurrent Manager Issues [ID 171855.1]
    Please also make sure you have proper entries in FND_NODES table -- How to Clean Nonexistent Nodes or IP Addresses From FND_NODES [ID 260887.1]
    Thanks,
    Hussein

  • Critical: Adding session-config to web.xml cause application NOT to start

    I added the <session-config> element under <web-app> in web.xml:
    <session-config>
    <session-timeout>30</session-timeout>
    </session-config>
    Now the app won't start!
    The reason: the built-in sun app server removes context-root attribute from <web-module> element in domain.xml when the app tries to start!
    Please fix this ASAP, guys!

    I placed it in the wrong place. After following the instructions contained in the Technical FAQ (below), it worked.
    Add the following element in your web.xml file, placing it after the mapping for the error servlet and before the welcome file list:
    <session-config>
    <!-- Set global default timeout to 60 minutes -->
    <session-timeout> 60 </session-timeout>
    </session-config>

Maybe you are looking for

  • How to tell what version of Acrobat or Reader was last used to save a PDF

    How can I tell what version of Acrobat or Reader was last used to save a PDF file? My users are using fillable forms from grants.gov. We want them to use Adobe Reader 8.1.3 to fill these forms, but some accidentally use the Pro version of Acrobat. Th

  • Canon es970 camcorder won't eject.

    My camera is about 15 years old. I have a tape in it as part of a project to convert from 8mm to digital. Now the camera won't eject my tape. Help! I have the plates off so I can see the housing of the tape/cassette area but I'm not finding the 'magi

  • How to adjust the speed of a single video demo clip

    This seems like a very basic function of a video that I can't seem to figure out in Captivate 8: For an individual video demo inside of a project, how does one go about turning up the speed of that clip? To be clear, I am not referring to simply view

  • I created a pdf with some filled fields.  The person I e-mailed it to said it was blank.

    I open a PDF, use form wizard to detect and create fields, end form wizard, fill in some of the fields, save doc, and e-mail it.  Recipient says PDF fields are all blank.  Does anyone know what I'm doing wrong? Using Acrobat 9 Pro.

  • JTree collaps after reload

    Hi I am using a dynamic tree - when i update a node i use: in the model: fireTreeNodesChanged(node,node.getPath(),null,null); //and then i revalidate and repaint the tree panel so it will be refreshed. //(I used to use reload(node) but this caused my