How do i access param/config values outside of war/ejb's

Hello,
I have some server specific values that I would like to look up in my application. But rather than doing a build specific to each server, I would like to store them in a properties file or something like that. What would you recommend? I was thinking of something like a properties file in the j2ee/home/lib directory but that doesn't seem to work. This would be some settings that apply to all 3 tiers (web/ebj/app-clients).
For example, we have email addresses in the web.xml. They are different for dev-test vs prod environments. Rather than change the web.xml for each environment's EAR, I would like a location or way to look up that information from the server.

so far, the only way I can think of doing this is to create a jar file that only contains a .properties file and then drop that into /j2ee/home/lib. Any better solutions?

Similar Messages

  • How can i access the app store outside the us?

    How can I access the app store outside the US?

    Technically, that would be a violation of T&C.

  • How can I access the Attribute Values from the Search Region

    Hi all,
    I have a table which contains Company id, department id, and PositonId. For a particular Company and Department there may be multiple records.
    I have to pupulate a table which contains the position and other details that comes under a particular Department and Position based on the selection in the Three comboBoxes.
    Also I have to populate a select many Shuttle to add new postions and records under a particular Department.
    I created a query panel *(Search Region)* for the serch and a table to display the data. That is working fine.
    Now the issue is I am using a view criteria to populate the shuttle with two bind variables ie, DepartmentId and CompanyId.
    If the serach will return a resuktant set in the table it will also pupulate the correct records, otherwise ie, if the if the serch result is empty the corresponding iterator and the attribute is setting as null.
    SO I want to access the attribute values from the Search Region itsef to populate the shuttle.
    I don't know how can I access the data from the Search Region.
    Please Help.
    Regards,
    Ranjith

    you could access the parameters entered in search region by the user as follows:
    You can get handle to the value entered by the user using queryListener method in af:query.
    You can intercept the values entered as described
    public void onQueryList(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    List<Criterion> searchList = qdes.getConjunctionCriterion().getCriterionList();
    for ( Criterion c : searchList) {
    if (c instanceof AttributeCriterion ) {
    AttributeCriterion a = (AttributeCriterion) c;
    a.getValues();
    for ( Object o : a.getValues()){
    System.out.println(o.toString());
    //call default Query Event
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    public void onQueryTable(QueryEvent queryEvent) {
    // The generated QueryListener replaced by this method
    //#{bindings.ImplicitViewCriteriaQuery.processQuery}
    QueryDescriptor qdes = queryEvent.getDescriptor();
    //get the name of the QueryCriteria
    System.out.println("NAME "+qdes.getName());
    invokeQueryEventMethodExpression("#{bindings.ImplicitViewCriteriaQuery.processQuery}",queryEvent);
    private void invokeQueryEventMethodExpression(String expression, QueryEvent queryEvent){
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory efactory = fctx.getApplication().getExpressionFactory();
    MethodExpression me = efactory.createMethodExpression(elctx,expression, Object.class, new Class[]{QueryEvent.class});
    me.invoke(elctx, new Object[]{queryEvent});
    Thanks,
    Navaneeth

  • How can i access any kind of java control inside ejb

    I want to access an ejb control of a session bean inside another session bean. Can anybody tell me how can i do that as the weblogic workshop doesnot give any option to add that.
    Thanks
    Sachin

    Hi,
    We can not able to add any type of javaControls inside the ejb project.
    Instead of that we can write our own code to get ejbs in an existing ejb's.
    Regards
    Anilkumar kari

  • How to access a Matrix cell value outside the matrix in textbox?

    Hi
    I have created a matrix in SSRS. Columns are grouped by Channel Type. I want to access indicated cells value outside the matrix. 
    After Running the report the report shows
    How can I access cell values outside the matrix? Please help

    Hi Aladin92,
    According to your description, there is a matrix in the report, you want to reference the first value of total outside the matrix, right?
    In fact, Report item expressions can only refer to other report items within the same grouping scope or a containing grouping scope. Are the both textboxes in the same group. To workaround the issue, please refer to the following steps:
      1. Click and select the matrix, copy it and paste it in the report above the original matrix.
      2. Right-click handle of the first row in the upper matrix, click Insert Rows, then click Inside Group-Above.
      3. Right-click second cell of the first row, then click Expression.
      4. In the Expression text box, type the expression like below:
    ="A total of "& ReportItems!Textbox5.Value & "out of 258 BC CCRs have been evaluated"
      5. Set the text boxes and rows visibility to be hidden except for the text box with expression.
    The following screenshots are for your reference:
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • I'm creating an array using a for loop, how do I get the values outside the loop while it is running? thanks

    I'm creating a set of values using a for loop and a shift register inside the loop. I want access to these values outside the loop as they are being created inside. When I connect a wire from the shift register to a display outside, it doesn't work. How do I do this? Thank you.
    Attachments:
    tamko_new.vi ‏29 KB

    I tried to create the local variable that was wired to numeric indicator inside the loop. If I try to connect this to the analog output outside the loop, the loop just starts blinking and nothing happens, am I doing something wrong? Thanks again.
    Attachments:
    tamko_new2.vi ‏29 KB

  • How to access each row value for a database item

    On my form I have a database datablock that represents a table in my database.
    5 rows are shown with a scroll bar that can be viewed to show the rest.
    The user is able to change some of the Database Item values represented in this datablock for any row shown in the datablock.
    I need to validate the correctness of the users change before allowing the database datablock to update the table in the database.
    But a database item in a datablock will represent a value for every row in the table. So how do I access each row value for a database item separately. What is the PL/SQL syntax?
    thanks,
    michelle

    In my situation it was better to use the loop instead
    of a when validate trigger because...Well it was clearly not better to use a loop that doesn't work. I don't understand what you're not clear on about the item and record validation triggers. If you have a specific validation rule for a single field (such as a date that cannot be in the future), that would go in a When-Validate-Item trigger on the date item. If the user enters a future date, your code would display an error message and raise a failure. Raising a failure prevents the item from being marked as valid. Invalid items prevent the record from being inserted/updated. Sometimes you have a validation rule that requires looking at more than one item at a time, such as two items that must either both be NULL or NOT NULL. In that case, you could not use a When-Validate-Item trigger because you can't clear or populate both at once. So then you would use a When-Validate-Record at the block level and if one field is NULL and the other isn't, you would display an error message and raise a failure. Forms is very civil in this respect; we don't throw exceptions around here, but then I digress.

  • How to Access the Return Value of a Function

    Hi,
    How do I access the return value when calling an Oracle function from .NET using Oracle.DataAccess.Client? The function returns an integer of 0, 1 or 99.
    Dim db_command_oracle As New OracleCommand()
    db_command_oracle.Connection = db_connection_oracle
    db_command_oracle.CommandType = CommandType.StoredProcedure
    db_command_oracle.CommandText = "swsarsi.import_appointments"
    Dim ret_value As New OracleParameter()
    ret_value.OracleDbType = OracleDbType.Int32
    ret_value.Direction = ParameterDirection.ReturnValue
    ret_value.Size = 2
    ret_value.OracleDbType = OracleDbType.Int32
    db_command_oracle.Parameters.Add(ret_value)
    Dim IN_student_id As New OracleParameter()
    IN_student_id.OracleDbType = OracleDbType.Varchar2
    IN_student_id.Direction = ParameterDirection.Input
    IN_student_id.Size = 10
    IN_student_id.Value = student_id
    db_command_oracle.Parameters.Add(IN_student_id)
    db_command_oracle.ExecuteNonQuery()
    messagebox.show(ret_value) ?????

    Your ODP.NET code looks correct. What error are you seeing?
    One thing that will definitely generate an error is that .NET message boxes require that strings be displayed. ret_value is a parameter object. You need to access its value and convert it to a string. At a minimum, you need to change that.

  • Redirection causes loss of param/attribute values

    Hello I am new to JSF and I have a few questions regarding the same .
    I am using (JSf-struts) for a web application in which I redirect a page (in the config class) .I am not able to access param/attribute values in the action class after redirection.
    Does redirection cause the loss of param values , if so what should be the remidy.
    If I want add an attribute (with session scope) how do I add it in the JSF
    can I do something like this ....
    <f:param name="datasets" scope="session" value="Master.txt" />

    Put in session
    FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(key,
                                                                                       obj);

  • How do I Access Data in XML Connector

    I have an XMLConnector attached to a xml file and bound to a
    label. This is working fine.
    My question is:
    How do I access the data values in a component or the
    XMLConnector through actionscript. I can see the values in their
    components so I know the data binding worked.
    Whatever I try returns undefined or null for the value.
    Different things I tried:
    // I tried getting it directly out of the data holder -
    returned undefined.
    var postions:Number = dh_rack.mountingPositions;
    //Tried getting it out of the XML Connector.
    import mx.data.binding.*;
    var dataTypeObj:mx.data.binding.DataType =
    this.xmlConn.getField("results", "rack.positions");
    var test = dataTypeObj.getAsNumber();
    var positions3 = dataTypeObj.getAnyTypedValue().value;
    Any help would be appreciated.

    I believe you have to use the following syntax:
    var positions:Number = dh_rack.data.mountingPositions
    or
    var positions:Number = dh_rack.data[mountingPositions]
    Good luck. I never get replies for my posts except from
    myself.

  • JAAS: How can I access the JAAS subject in an EJB?

    Hello,
    I try to understand the JAAS integration in J2EE 1.3.
    I know:
    J2EE defines a role-based container managed authorization for the web and ejb container. Roles, users and their relationship are defined in the realm.
    JAAS has a more sophisticated policy-based authorisation model. Since J2EE1.3 I can define a realm using JAAS having the role-based authorization of the container managed security.
    My question:
    How can I access the JAAS subject object in an EJB or servlet to use the policy-based authorization?
    Thank you for your answers
    Peter

    May be I should redefine my question:
    If I use JAAS as J2EE-Realm, how can I receive the subject?
    All JAAS-Tutorials contains code fragments like
    LoginContext lc = new LoginContext("entryFoo");
        try {
            // authenticate the Subject
            lc.login();
            System.out.println("authentication successful");
            // get the authenticated Subject
            Subject subject = lc.getSubject();But if I use JAAS as J2EE-Realm the container creates the LoginContext.
    Whom can I ask for the subject now?
    There is no such method implemented in the EJBContext, the HttpServlet or HttpServletRequest!
    Peter

  • Access custom variable value in web.xml context-param?

    My requirement or need is to access a variable value either in a class in my Model project or a backing bean in my View project. For example, one variable I need to access is an application server I am integrating with - 'testserver' or 'productionserver' - I want to be able to configure this within an external file so that I do not have to re-compile my application to change the variable.
    I was thinking about placing this variable in the web.xml <context-param> section as:
    <context-param>
    <param-name>servername</param-name>
    <param-value>testserver</param-value>
    </context-param>
    I need to access this value within a class (not a servlet) on an Application Module service method, though if needed, I could access it from a backing bean and pass it to the service method (less desirable.) Is this a good approach and how do access this variable from within a Java class including any imports I need to do (code example)?
    Thanks and Happy New Year!
    Hopefully most everyone is out spending time with friends and family versus stuck trying to complete a project like me...

    I found an example from SRDemo that provides what I was looking for:
    String serverhostaddress =
    FacesContext.getCurrentInstance().getExternalContext().getInitParameter("param-name-var-in-webxml");

  • Accessing param values using RichFaces Drag n Drop

    Hello everyone,
    I'm using RichFaces drag and drop support and I want to pass an additional parameter so that I can access it's value when processing the dragged/dropped object.
    My JSP has:
    <rich:dragSupport dragIndicator=":indicator" dragType="measure" dragValue="#{measure}">
           <a4j:actionparam name="operator" value="#{aggOp}" assignTo="#{SessionBean.tempAggOp}"/>
           <rich:dndParam name="label" value="#{measure.name} (#{aggOp})"/>
    </rich:dragSupport>
    <h:outputText value="#{aggOp}" style="font:11px arial;"/>On my backing bean method that processes the event, I can access the object's properties fine, but the param has a strange behaviour:
    The first time I drag an object, the param value is null on the bean. The second time, it has the value it should have for the first dragged object, and so on.
    Apparently the param value is being updated after the drop event method is called. Any ideas on how to change this please?
    Thanks in advance,
    ~Ruben

    To solve this problem I used <f:param> instead of actionParam:
    On the drag support component:
    <rich:dragSupport dragIndicator=":indicator" dragType="measure" dragValue="#{measure}">
                                                        <f:param name="operator" value="#{aggOp}" />
                                                        <rich:dndParam name="label" value="#{measure.name} (#{aggOp})"/>
    </rich:dragSupport>     On the backing bean:
        //dropped item processors
        public void processDropSupportTable(DropEvent dropEvent) {
            if (dropEvent.getDragType().compareTo("measure") == 0) {
                SOLAPMeasure dragged = (SOLAPMeasure)dropEvent.getDragValue();
                FacesContext context = FacesContext.getCurrentInstance(); 
                Map requestMap = context.getExternalContext().getRequestParameterMap(); 
                String tempAggOp = (String)requestMap.get("operator");
                System.out.println("dropped: " + dragged.getId() + " named: " + dragged.getName() + " whose operator is: " + tempAggOp);
        }

  • How can I access my Call Handlers from outside line (outside district)

    CISCO VoIP System Info:
    Cisco Unity Connection version: 8.6.2ES25.21900-25
    CM Admin System version: 8.6.2.21900-5 on C200M2 Servers
    Our engineer setup our Call Handlers so that in our to change the recordings on them, you diall 7800 from a phone inside the office, or as he put it in the procedures, from within the district.  Once you dial, you need to enter the user code, password, then the extension of the Call Handler, and we have no problems recording/changing any Call Handlers.  However, due to possible inclement weather approaching in the next few weeks, I was asked how we cna change them from an outside line (manager's home, etc.).  We cannot access from an outside line.  7800 is not a DID, it is simply the extension he assigned to access the call handlers.  I even went so far as to setup a dummy phone and forward it to 7800, but this does not work either.  It forwards to the extension's voicemail.  Is there a way we can access the Call Handlers from an outside line?  Any help would be gretaly appreciated.  Thank you in advance.

    Hey Joseph,
    Go Flames ....errrrrrrrrrrrrrrrrrr maybe not so much
    What you are trying to get to is really just the Greetings Administrator
    conversation and there are multiple ways to get there.
    For example, you can set up a Caller Input off any mailbox (Press 1-9) let's say 7 to
    go to Conversation> Greetings Administrator. So you could set this on the managers mailbox
    and when he calls his own number from home once his greeting
    kicks in he can press 7 to link to the Greetings Administrator conversation
    or
    You could set up a DID DN xxx-xxx-2345 as a CTI-RP and set Call Forward All to reach Unity Connection.
    In this case you will need to use the Forwarded Routing Rules = xxx-xxx-2345 route to
    Greetings Administrator. Make sure to move this rule to the bottom of the list!!
    Cheers!
    Rob
    "Why do the best things always disappear " 
    - The Band

  • How can I get the default value of a particular preference programatically. I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.

    <blockquote>Locked by Moderator as a duplicate/re-post.
    Please continue the discussion in this thread: [tiki-view_forum_thread.php?comments_parentId=702631&forumId=1]
    Thanks - c</blockquote>
    == Issue
    ==
    I have a problem with my bookmarks, cookies, history or settings
    == Description
    ==
    How can I get the default value of a particular preference in FireFox?.
    I know I can see the default value for some of the preferences in about:config but, I need a programatic way to get the default value.
    I see some that there are values for preferences in firefox.cs but I am not certain that these are being used as the default values for preferences. prefs.js in user's profile only has the updated values and not the default values.
    Any help towards acheiving this programtically is greatly appreciated.
    If the default values are stored in a file, kindly let me know the format in which it is stored for me to parse it programatically.
    == User Agent
    ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)

    Dear Friend,
    Here when you have the callableSattement as ?=proc(?), the first ? is an output parameter. So you should register it as out parameter using registeroutparameter.
    Then you can get the value from the outparameter using callablestatement.getXXX().
    Try that way.
    For free tral versions of JDBC Drivers go to www.Atinav.com

Maybe you are looking for

  • The type tool is not working

    I upgraded from PSE9 to CS5 and I can no longer view any of the fonts or use the type tool in either program.  What do I need to do to fix this issue?  Thanks for any help!  Cindy

  • How to execute a class wich is not in the classpath

    Sometime the server can't be shutdown and, if You add some new classes to Your system there's a classpath problem : in the classpath OC4J doesn't see new classes How can we solve that problem ? Is it possible to execute something wich is not in the c

  • Process ADD(increment) using SSIS for a dimension with two Key columns

    Hi, I'm trying to add data to the existing dimension using Process ADD increment (SSIS data flow). The dimension has 2 key columns (ID and Timestamp) and when I do a full process for a particular day the dimension run's fine, but when I try to add da

  • Why has my pdf document "failed to export"?

    I've just bought a subscription to export and convert pdf files to Word files, and only the second document I tried to convert is refusing to do so, giving the message "failed to export.  There was an unexpected problem".  Is there anything I can do

  • Update from Oracle Indentity Manager 9.0.1.0 to 9.0.2.0, Missing XML

    Hi! im trying to upgrade my OIM from 9.0.1.0 to 9.0.2.0 using the patches p8484010 and then p13116984, but when im trying to upgrade OIM in my testing VM some errors appear when i try to execute the step *3.2.3 Loading Metadata into the Database* , d