Wanted Global parameter!!!

Hi All,
We would like to store global parameters in the web.xml file or by other means in a central file, that can be accessed by any JavaBean, JSP, etc.
How can we do that, and what are the methods utilised to retrieve these parameters and use in JavaBeans, jsps, CustomTags, etc.
We have several jsp pages that are used to connect to a database and retrieve records. At the moment, we have hard-coded the:
a) IP address for the server;
b) jdbc driver name
c) path of the database server;
d) user name for the database connection;
e) password for the database connection.
Our intention is to centrally store this information, and then retrieve whenever we need.
Thanks in advance for any help.
Cheers
Trajano Roberto

from J2EE spec:
"a set of context initialization parameter can be associated with a web application and are made available by the following methods of the ServletContext interface :
getInitParameter
getInitParameterNames"
now from tomcat's basic web.xml file ( replace > by > to make it correct ) :
   <!-- Context initialization parameters that define shared
         String constants used within your application, which
         can be customized by the system administrator who is
         installing your application.  The values actually
         assigned to these parameters can be retrieved in a
         servlet or JSP page by calling:
             String value =
               getServletContext().getInitParameter("name");
         where "name" matches the <param-name> element of
         one of these initialization parameters.
         You can define any number of context initialization
         parameters, including zero.
    -->
    <context-param>
      <param-name>webmaster</param-name>
      <param-value>[email protected]</param-value>
      <description>
        The EMAIL address of the administrator to whom questions
        and comments about this application should be addressed.
      </description>
    </context-param>you'll find this file at the following address :
http://jakarta.apache.org/tomcat/tomcat-3.3-doc/appdev/web.xml.txt
hope it helps
raphaele

Similar Messages

  • Global Parameter

    Hi All,
    I need to set a global parameter which can be used in all my mappings. How can this be done in OWB ? Is there any way of doing this without the use of a external flat file or temporary table to store the parameter?
    I sometimes wonder what is the use of a Mapping Input Parameter, I hope it cannot be used for this purpose !!
    rgds
    -AP

    Hello, AP
    If your global parameters are not volatile you may prefer to place them to the package as a constants or functions. You could latter refer them in your mappings.
    Advantage – performance throw PLSQL code caching (you could even pin this “parameter package” in memory), disadvantage – change parameter values requires recompilation of all dependent objects.
    Serhit

  • The best place to put the global parameter

    hello:
    i am now studying the petstore1.3,and find that the global parameters are kept in the servlet context,i wonder if it is a good solution.in my project,i seldom use the servlet context,session context etc,i feel more like to put the global parameter in a singleton that is loaded when the app is started. i don't know where is the best place to put the global parameter,servlet context or singleton?

    thanks for your answer.
    1 do your mean that the singleton can be shared among the different "war"
    packages if both of them are within the same jvm?if yes,must they be in the
    same "ear" package?
    2 if my app is deployed in the weblogic cluster environment,which one can be
    shared? singleton or servlet context?

  • Global parameter value change in biacm

    Hi friends,
    When i tried to change the global currency code 2 from 'EUR' to 'USD', im not able to edit the value 'EUR' value in the configuration manager. When i try to edit the currency code 2 it is not returning any parameter currency value in the edit dialog box to change.
    What was the reason, as it is not showing any values inorder to edit the currency code in the configuration manager.
    Thanks in advance.
    Regards,
    Saro

    Hi friends,
    Got the solution for the above issue in the metalink ID: Doc ID 1582321.1.
    Regards,
    Saro

  • How to clear Global Parameter ID.

    Hello Friends.
    How can I get clear Parameter ID value, which was set in the program. suppose, if value is set to 'X', How can I make it to '  '.
    Sathish Kumar

    hi
    good
    use like this
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETER statements.
    To fill one, use:
    SET PARAMETER ID <pid> FIELD <f>.
    This statement saves the contents of field <f> under the ID <pid> in the SAP memory. The code <pid> can be up to 20 characters long. If there was already a value stored under <pid>, this statement overwrites it. If the ID <pid> does not exist, double-click <pid> in the ABAP Editor to create a new parameter object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID <pid> FIELD <f>.
    This statement fills the value stored under the ID <pid> into the variable <f>. If the system does not find a value for <pid> in the SAP memory, it sets SY-SUBRC to 4, otherwise to 0.
    thanks
    mrutyun^

  • EAR file, where define a global parameter

    Hello
    I have an J2EE enterprise Java project running on IBM WebSphere. This J2EE project consists of a web module (dynamic Java project) and a EJB module project:
    MyJ2eeEAR
    -TheWebmodule.war
    -TheEJBModle.jar
    I will define a parameter, so that the web module classes as well as the EJB module components has access to it and can ask for his new state.
    Where should the parameter be defined?
    Thanks for any help.

    I put mime as context parameters in web.xml. Sometime I put them in the container's JNDI registry if they can be injected or needed to be shared across contexts.

  • I want a selection screen parameter in days

    HI all,
    I want a parameter in the selection screen. That parameter should be in Days.
    can any body tell me..
    Edited by: Julius Bussche on Aug 19, 2008 11:31 AM

    Hi.....
    > p_var type DPAST_KK
    or
    > p_var like INTITIT-INT_DAYS
    Thanks,
    Naveen.I

  • Procedure in Global Country parameter

    Dear all,
    I have just created one new client for testing. a new fresh client and imported setting for default client 000 (SAP).
    When i began to customized i found that procedure in country global setting for ID Indonesia is blank so i look for TAXID and i can't find it.
    Could you tell me the function of "country global parameter" procedure.
    I should fill TAXID where can i define it?
    thank you.
    regards,
    freddy

    Here is an example
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> create or replace type test_varray as varray(10) of varchar2(10)
      2  /
    Type created.
    SQL> create or replace procedure print_varray
      2  (
      3     pVarray test_varray
      4  )
      5  as
      6  begin
      7    for i in 1..pVarray.count
      8    loop
      9      dbms_output.put_line(pVarray(i));
    10    end loop;
    11  end;
    12  /
    Procedure created.
    SQL> set serveroutput on
    SQL>
    SQL> exec print_varray(test_varray('a','b','c','d'))
    a
    b
    c
    d
    PL/SQL procedure successfully completed.
    SQL>

  • Using both populate global  and manual populating attributes

    Hi,
    I am using IDM 8.0 with Flat file active sync using following parameters in FF synchronization policy.
    Populate Global = checked
    Track Last Processed Timestamp =true
    Process Differences Only=true
    My create user process is working fine but I DO NOT want to update the attributes such as First name when its value in flat file is null. My following code is working in update user form if I DO NOT use populate global parameter. But i want to use Populate global parameter.
    Here is my code in update user form
    <Field name='accounts[Lighthouse].firstname'>
                    <Expansion>
                        <block >
                            <defvar name='potentialValue'>
                                <ref>activeSync.firstname</ref>
                            </defvar>
                            <cond>
                                <ref>potentialValue</ref>
                                <ref>potentialValue</ref>
                                <ref>accounts[Lighthouse].firstname</ref>
                            </cond>
                        </block>
                    </Expansion>
                    <Disable>
                        <or>
                            <isnull>
                                <ref>activeSync.firstname</ref>
                            </isnull>
                            <eq>
                                <length>
                                    <ref>activeSync.firstname</ref>
                                </length>
                                <i>0</i>
                            </eq>
                        </or>
                    </Disable>
                </Field>Is it possible to use both manual as well auto populate attributes. If so, How can I stop updating firstname attribute when the firstname attribute value is null along with populate global parameter enabled.
    Any help will be appreciated.
    Thanks

    Any reason why you write your result into accounts[Lighthouse].firstname instead of global.firstname when you are using populate global?
    Try something in the line of this:
    <Field name='global.firstname'>
      <Expansion>
        <cond>
          <or>
            <isnull><ref>activeSync.firstname</ref></isnull>
            <eq><length><ref><activeSync.firstname</ref><i>0</i></length></eq>
          </or>
          <ref>accounts[Lighthouse].firstname</ref>
          <ref>activeSync.firstname</ref>
        </cond>
      </Expansion>
    </Field>

  • Duplicate line in Global variable

    Hi Experts,
    I have one BODS job which will load the data from BW to Non SAP.  As per my business requirement I have to trigger this job from BW Process chain. For that I have added BODS job in Process Chain Variant and given input to global variable before execute the PC, it was working fine. Now I want to change the Global parameter value for that I open the PC variant it was showing multiple line items and I am not able to run this from Process Chain. Please help me if anybody faces this issue.
    Version: BW 7.3
    BODS Version : 4.1 SP2
    Regards
    M Ramesh

    Hi All,
    When you use the process type "Start job in SAP BusinessObjects Data Services" in a process chain , in the variant maintenance there are duplicate entries created in the global variables. This is due to a Internal Program error. 
    Apply note 1989821 ( Duplicate entries in Global variables for BOBJDS job in process chain)
    Regards
    M Ramesh

  • How to call form and pass parameter from OA Page

    Hi,
    I have one requirement to call a custom form from OA page by clicking the button and the same time i need to pass one parameter from this
    oa page to that form.
    how to do this by personalization?
    i surfed lot and i got some idea, some one said "pass the value as global variable and receive the global parameter when the new form instance trigger" .
    Can anyone please give about about this ?
    Thanks in advance,
    SAN

    This seems to be related to EBS and since this forum is dedicated to Fusion you might want to post the question to E-Business Suite forums and
    Support forum for EBS customizations.
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

  • Adding global system properties

    Hello,
    I know that there are some system properties that are available by default via the System.getProperty method. I also know that I can programatically add my own properties to that list.
    My question is...Is there some way for an admin to add custom properties to that list through the Visual Administrator or Configuration Manager?
    The reason I ask is because we want to have some properties that will have the same name on each runtime environment but different values. For example, let's say we have a property named NOTES_CONTENT_SERVER which will contain a different server name on DEV, QA and PROD.
    Please ask if this question is not clear.
    Thanks in advance for any help.
    David.

    Start the config tool, then in the tree structure in the left hand pane navigate to: cluster-data > instance_XXXXX > server_IDXXXXX (highlight this node).
    In the General tab that will appear in the right hand pane you will see a label titled "Java parameters:" with a corresponding text field where you can enter all your JVM parameters. Add your global parameter like so "-Dmy.global.prop=blah".
    Save your settings, and restart the cluster, you can then lookup the property in your code: System.getProperty("my.global.prop");
    Of cousre you could have learned how to set JVM properties with the config tool on the SAP help site here:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/4e/d1cf8d09a94ae79319893c2537d3a0/frameset.htm

  • Address with Type 'Define Dynamically' using Global Data

    Hello,
    in a new created Adobe form Program Lines are no longer available. How can a global variable be set?
    The global variable is used in an Address as Dynamic Address Type.
    Thank you very much for your help.
    Kind regards, Marion Hergert

    hi,
    generally the global parameters will be declared and do some logic in the intrface. in the address node,for dynamic address type  parameter should be 3rd one ( am not sure), drag the global parameter into that field and  you can proceed further.
    The following logic I have used when I developed the forms when there is no address number.
    I think you can use the similar logic in your case.
    If your application makes no use of the Business Address Services but you still want to have country-specific addresses, you must use ABAP coding to achieve this. It is possible to do this in the application program or in the initialization coding of the interface. The example here describes the latter option. You need to call the function module ADDRESS_INTO_PRINTFORM. Among its parameters, you will find address_1. This structure contains all relevant address fields, like name, street, city, or country. These fields must be filled with the address data from your application. In other words, you must take care to create a correct mapping of the address fields from your application and the individual address fields of structure address_1.
    You should determine the value of parameter number_of_lines. It equals the maximum number of lines that will be created from the address data. Function module ADDRESS_INTO_PRINTFORM returns an internal table address_printform_table, which has only one column. Every line contains one line of the address that has been assembled according to the addressee's country. These lines need to be converted into a two-column internal table of type tline that can be used as the source of a dynamic text in a PDF form. Its two columns are:
    TDFORMAT - contains the paragraph format of the line (e.g. an asterisk for the default format)
    TDLINE contains the text itself.
    Addresses Without Business Address Services - Coding
    TYPE-POOLS: szadr.
    DATA:
      ls_address       TYPE adrs1,
      lt_address_lines TYPE szadr_printform_table,
      ls_address_line  LIKE LINE OF lt_address_lines.
    *map address fields from work area to fields from function module
    ls_address-title_text = is_customer-form.
    ls_address-name1      = is_customer-name.
    ls_address-street     = is_customer-street.
    ls_address-post_code1 = is_customer-postcode.
    ls_address-city1      = is_customer-city.
    ls_address-country    = is_customer-country.
    CALL FUNCTION 'ADDRESS_INTO_PRINTFORM'
      EXPORTING
        address_1               = ls_address
        address_type            = '1'                       "normal/company
        sender_country          = iv_sending_country
        number_of_lines         = 6
      IMPORTING
        address_printform_table = lt_address_lines.
    DATA: ls_dynamic_text TYPE tline.
    LT_DYNAMIC_TEXT would be defined as a global field
    of the interface as follows:
    lt_dynamic_text TYPE TABLE OF tline
    LOOP AT lt_address_lines
      INTO ls_address_line.
      ls_dynamic_text-tdformat = '*'.
      ls_dynamic_text-tdline   = ls_address_line-address_line.
      APPEND ls_dynamic_text TO lt_dynamic_text.
    ENDLOOP.
    pass this internaltable to the context. drag that table  in the layout.

  • Carry matnr from line item to search help parameter??

    Hi All,
            Is it possible to have a line item material number carried forward into a search help parameter field automatically? So say a user has entered material 123456 in sales order line item and now wants to use the F4 help in the batch field for that line item, is there a way of having the 123456 matnr in the material number parameter on the search help when the dialog opens?
    If so how is this achieved?
    Many thanks.

    Hello Friend,
    I think it is possible..if user is agree to press 'Enter' after entering material number...
    so that it goes back to any event and you catch the material number in runtime...
    and with that Material number change the value of global parameter of material number ( you can check in data element )
    { SPA )
    after that if user press F4 in the batch field...materiial number
    Hope it will solve the problem.
    Regards
    Krishnendu

  • JSP HTML parameter form to call report - Dependent  drop down list

    I have a report parameter form developed using HTML & JSP to call oracle reports6i.
    First parameter "STATES", Second Parameter "CITY"
    I have a master-detail relation betwen STATE & CITY table.
    I want the parameter form drop down lists dependant. ie if the user chang STATE value in the first drop down, the second drop down list CITY shoud
    change automatically.
    Please help
    Thanks
    Vimal

    Vimal,
    This is not functionality that's available in the Reports generated parameter form. In order to do this you'll need to build the parameter form yourself as a true HTML form and code the javascript to link the fields.
    Hope this helps,
    Danny

Maybe you are looking for

  • TDS line items are not Display in FB60

    Hi Experts, when in simulate a document in  T code- FB60. the TDS amount is calculated properly . DR , Cr is ok but the Line item of the TDS is not displayed.  when i post the document and open in FB03 all line items are dispalyed with TDS Line items

  • Jar file in applet not saved in internet files when using jdk plugin

    Hello, I recently upgarded to jdk1.3.1 and converted our applet and classes to jdk1.3.1 using swing classes. From there, we converted the html file with htmlconverter and diployed this on the web. When a user goes to the web, the system automatically

  • Header files  not being included in JNI

    I've written a java program which interfaces with some C code.In the c code i use certain functions which are defined in a header file that i include in the same c file.The problem i have ,is that the compiler shows an error when it comes across one

  • How to create the fact table

    pleae let me know how to create the fatc table by using pl/sql packages Edited by: 792988 on Sep 6, 2010 3:34 AM

  • Lightroom 2.2 and CS3 Panorama/Merge (Windows)

    Prior to a system crash, merge/panoramas worked flawlessly for me on a Windows Vista system. At the time, both LR and CS3 were on the same drives. Since the crash, I have the two programs on different drives and other than basic edits, all other opti