Put the param-value property of web.xml relative instead absolute

Hello

In my web.xml file, I value < param > absolute direction pointing to the properties file. But this method has a problem when I run the application in the other computer, because I have to change the direction to run the application again. For this reason I want to put the direction bit up to the application, but I don't know how to do it.

Currently the strutcture web.xml is the following:

..............
< init-param >
< param-name >
Chart.Properties < / param-name >
< param-value >
E:\\Aplication\\web\\WEB-INF\\chart. Properties
< / param-value >
< / init-param >

..................

I would be very grateful if someone could help me solve this problem.

Concerning

There are always alternatives :-)
In this case, the alternative solution would be to use the ServletContext getRealPath() or getResourceAsStream() method.
In this way, you can load a resource from your web application, regardless of where it is deployed.
It's practically the same solution, except for the resource specified from your web application, rather than the path of the classes.

It is a perfectly acceptable method of Classpath and alternative might be better in terms of use of the servlet API rather than the standard java classpath.

see you soon,
evnafets

Tags: Java

Similar Questions

  • How can I get the text value of an element XML in MXML?

    Hello


    I have the following XML loaded into a variable of XML type:

    Properties of <>
    the RIMpro data collector Configuration < comment > < / comment >
    < key="server.pear.username"/ entry >
    < key = "enter server.apple.retry.times" > 5 < / entry >
    < Enter key = "rdc.proxy.host" > http://192.168.1.2:8080 < / Entry >

    /Properties >

    I can easily get the key attribute displayed in a DataGridColumn by setting the dataProvider my variable and the data in "@key" area  But I don't know how to get the text value in a second column...  Is it possible or do I have to change my XML to something like this:

    Properties of <>
    the RIMpro data collector Configuration < comment > < / comment >
    < key="server.pear.username"/ entry >
    < key = "enter server.apple.retry.times" value = "5" > < / entry > "
    < Enter key = "rdc.proxy.host" value ="
    http://192.168.1.2:8080"""> < / entry > "

    /Properties >

    Thanks in advance.


    Marc

    Yes, you'd better change your XML structure to fit the internal mechanisms of the DataGrid.

    As model dataField require each element of the grid line to have a named property to display, otherwise you will be forced to overcome this model to the custom help labelFunction for the particular column that will implement your custom actions on how to extract the appropriate data for this column of the grid line item. It will be much more complicated that just reorganize your xml structure.

  • Put the string value in a table

    Hello

    Probably an easy question, but I am reading data of a RFID reader that returns a string value of 12 bytes. Whenever a RFID reads, I want the tag to be inserted in a string table on the front panel. So, basically, a newspaper of the each tag [read-> Insert row 0] then [read-> Insert level 1] and so on. I work RFID reader, I don't know how to put the string in the table.

    I'm not sure of the steps necessary to achieve control of the table (or if the table control is the right thing to use).

    Any help would be greatly appreciated. Thank you.


  • Win 8 again to choose a browser, even after I put the default value, I have a screenshot

    On opening of browser, I wonder to set the default browser. After I do I get the message send me options I guess come from Msoft: continue using FFox, choose IExp, choose the program from the store.
    I have a page, if you need it.

    Keep up the good work, guys.

    Your list of details of the system shows that you have a user.js file in the profile folder to initialize prefs each time you start Firefox.

    The user.js file is present than if you or another software has created this file and normally it wouldn't be here.
    You can check its contents with a text editor (right click: open with) If you do not create this file yourself.

    The user.js file is read whenever Firefox is started and initializes the preferences to the specified value in this file, so the preferences set via user.js can be changed temporarily for the current session.

    Delete possible user.js and files numbered prefs-# .js and rename (or delete) the file prefs.js to reset all the prefs by default, including the prefs set via user.js and pref which is no longer supported in the current version of Firefox.

    You can use this button to go to the Firefox profile folder currently in use:

  • I don't want to search for the navigation bar. I want to put the address and it goes to the address. But I now I put the address of and he did a search instead. Why? How can I change that.

    Like I said how can I just put the address in the navigation bar, and it goes to the address instead of search.

    See:

  • How to reset the param value

    Hello

    In MY search page, I'll put a value of param (FormValue) when create button is pressed and based on that value I wrote code in my application to process home page.


    In my main page, I have the update button when I press this button Iam trying to reset the value of param (FormValue) to null...

    I wrote the code so that when below Update button and Iam trying to SOP the value, but it's not methoeds.



    in my searchpageCO

    HashMap params = new HashMap();
    params.put ("FormValue", "Y");

    In my CreatePageCO:

    HashMap params = new HashMap();
    params.put ("FormValue", null);

    When I tried to SOP even after the null. his rest, printing the form "Y".


    can someone plz help me im trying the approach is correct or not?

    Thank you
    Mahesh

    Try like this

    if("Y".equals(fromval1))
    {
    }
    

    Thank you
    AJ

  • How can I put the code in dreamweaver/designer side by side instead of up and down?... Vs vertical horizontal screen

    Screen Shot 2015-05-23 at 1.45.59 PM.png

    Go to view > split vertically.

    Nancy O.

  • Replace values web.xml with a deployment plan.  Does not not on WL 10.3.2

    Hi All-

    I am trying to replace a value of web.xml to one on a weblogic deployment plan. I deployed the application on WL 10.3.2 and used the deployment below plan. No matter what I do it does not seem to appreciate in value.

    Web.XML:

    <? XML version = "1.0" encoding = "windows-1252"? >
    <! DOCTYPE web - app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3 / / IN" "http://java.sun.com/dtd/web-app_2_3.dtd" >
    <>web - app
    ...
    < context-param >
    TokenGroup < param-name > < / param-name >
    OldValue < param-value > < / param-value >
    < / context-param >
    ...
    < / web - app >

    Deployment plan:

    <? XML version = "1.0" encoding = "UTF - 8"? >
    <-plan of deployment xmlns = "http://xmlns.oracle.com/weblogic/deployment-plan."
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance".
    xsi: schemaLocation = "http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd".
    global variables = "false" >


    APPName < application name > - < / application_name >

    > definition of variable <
    < variable >
    < name > TokenGroup < / name >
    < value > Key123456 < / value >
    < / variable >

    < / variable-definition >


    < module-override >
    < module name > APPName.war < / module-name >
    war of < module-type > < / module-type >
    < descriptor-external module = "false" >
    Web - app of the < root > < / root >
    < uri > WEB-INF/web.xml < / uri >

    > assignment of variable <
    < name > TokenGroup < / name >
    < xpath > / web-app/context-param / [param-name = "TokenGroup"] / param-value < / xpath >
    Replace < operation > < / operation >
    < / variable assignment >


    < / module-descriptor >
    < / module-override >
    < / deployment plan >


    I also tried other formats for the xpath expression such as:

    / Web-App/Context-param / {param-name = "TokenGroup"} / param-value
    / Web-App/Context-param [param-name = "TokenGroup"] / param-value

    Any ideas why it does not work?

    Thank you
    Joe

    "web.xml".
    -------------




    name
    Joe


    password
    password


    ParameterServlet
    ParameterServlet


    ParameterServlet
    / ParameterServlet

    ParameterServlet
    ------------------------
    import java.io.IOException;

    import javax.servlet.ServletConfig;
    to import javax.servlet.ServletContext;
    to import javax.servlet.ServletException;
    Import javax.servlet.ServletOutputStream;
    Import javax.servlet.http.HttpServlet;
    to import javax.servlet.http.HttpServletRequest;
    to import javax.servlet.http.HttpServletResponse;

    SerializableAttribute public class ParameterServlet extends HttpServlet {}
    private String dbName = "";

    private String dbPassword = "";

    Public Sub init (ServletConfig config) throws ServletException {}
    Super.init (config);
    ServletContext context = getServletContext();
    dbName = context.getInitParameter ("name");
    dbPassword = context.getInitParameter ("password");

    }

    ' Public Sub doGet (HttpServletRequest req, HttpServletResponse res)
    throws IOException {}
    ServletOutputStream out = res.getOutputStream ();
    res.setContentType("text/html");
    out.println(")Basic servlet");
    out.println(")Database user name is "+ dbName);
    out.println(")

    Database password is "+ dbPassword +"");
    out.println(")");
    }
    }

    'Plan '.
    --------------


    virtual


         name

         akshay1
         
         
         password
         koul1
         



    virtual
    war

    Web - app
    WEB-INF/web.xml
         
              name
              / Web-App/Context-param / [param-name = 'name'] / param-value
              replace
         

         
              password
              / Web-App/Context-param / [param-name = "password"] / param-value
              replace
         



    C:\DOCUME~1\user\LOCALS~1\Temp\user\.\config\deployments\virtual\plan

    It works for me... I think that your file "web.xml" is the origin of the problem.

    Try to replace



    with


    I hope this helps.

    -Akshay

  • need to update the value of the column automatically (exists and the new value)

    Hello

    (1) I Segment1, Segment2, Segment3, Segment4, item_status (new column modified in the Temp table)

    Must update the form OFA and the DB Temp table item_status value in the column when I click APPLY to SAVE the Inserted records in the DB table and form and must register the mtl_system_items_b Segment1, Segment2, Segment3, Segment4 in which the condition

    Note: need to update automatically item_status for existing and new inserted records in the Table and the form

     Serializable[] param = {Segment1, Segment2, Segment3, Segment4
                       };
                       am.invokeMethod("InsertRecord", param);
                       row.setAttribute("SelectFlag", "N");
    

    Thank you

    Renon,

    When you write code, try to understand what makes each line. (If you don't understand all the lines, feel free to ask)

    row.setAttribute ("ItemStatus", row.getAttribute ("ItemStatus"));

    What do you think that the above line done? You try to get the value of the attribute and trying to put the same value. How is it, that will have an impact?

    You need to do 2 things.

    1. change the insertRecord method and the State of return of this method.

    Change the definition of the function:

    public String InsertRecord (String itemstyle, String itemcust, String itemsize, String itemcolor, String ordrno,

    String desc)

    Add a return statement at the end after validation.

    TR.Commit ();

    return the situation;

    }

    2 accept that status in CO and set the value to the attribute details VO.

    String status = (String)am.invokeMethod ("InsertRecord", param);

    row.setAttribute ("ItemStatus",status);

    I hope this helps.

    See you soon

    AJ

  • get the return value of a method of the application module in the workflow

    Hello

    I use jdeveloper 11.1.1.7.0

    I defined a method (return type is useful java card) in the Module of the Application and add this method to the client interface.

    also I have a workflow and in this TF firstly I should execute this method and put the return value for the pageFlowScope parameter. I know that to use this method as a methodCall and set it as an activity by default, but I don't know how to get the return value before entering the jsff page and set the pageFlowScope parameter.

    Habib

    Concerning

    When you add the activity to the way to deal, there are 'Return value' property that you can set to #{pageFlowScope.yourVariable}

    Dario

  • set the input value using a workflow setting?

    Jdev 11... 2
    I have a taskflow browse master / detail that called the edict taskflow passing parameters to a router that will either modify it or create method for the detail record (change/create master is in a different position). I can successfully modify/create the main form and I can change/create the detailed form, but I didn't understand how to set the input value for the agency_Id (of the master) in detail. I control data binding to create my detail record 'create', and I have a task flow parameter that has the agency_id I want as the default value in the detail. I don't know where to put the input value. I tried to add another method to the method call that has her 'create' binding for retail, but it seems that I can have only a single method. Do I need another method call to set it? Or should I do something programmatically? (I'm Javaless, so hopefully I can do declaratively).

    Thanks much for any help. If I can figure out how to make this piece, I'll have the beginning of an application that does something useful.

    LB

    Hello

    There is a new Createmethos called 'create with Params' that you can use for this.

    http://www.Oracle.com/technology/products/jdev/tips/fnimphius/createWithParameters/createWithParameters.html

    Simply plug the parameter to the variable of pageFlowScope containing the input parameter

    Frank

  • How can I add value to the existing values over a period of time?

    Sorry guys, I apologize in advance because I think that this problem can be very simple, but I had been mind blocked through hours of Labview tutorial and try it.

    "Lets say, I'm working on a parser of training and the z axis lower to 0 every time, I have it counts as ' 1 count ', I wanted to add the total number of charges. Can I use an array to store the 'total '? I try to use register to shift and it gives me only the current number and the previous, i.e. I get 2 whenever I'm doing a count.

    If you want just a number, a scalar value must be what you put in the shift register, not a table.

    If the condition is true, add one to the value in the registry to shift and move it back in.  If the condition is false, then just put the current value in the registry change to.

  • OBIEE dashboard how to set the default value of a prompt dynamically

    Hello

    I have a prompt that displays the quarter of the year. I want to put the default value of this prompt dynamically. So, if sysdate is between January and March, then fast should say 'Q1 '. If the month of sysdate is between April and June, then fast should say 'Q2'... etc.

    I set the default selection of the prompt SQL suite and put in the following code:

    SELECT BOX WHEN EXTRACT (MONTH FROM sysdate) IN (1,2,3) and THEN "Q1" double WHEN RETRIEVED (MONTH OF sysdate) (4,5,6) and THEN "Q2" double WHEN RETRIEVED (MONTH OF sysdate) (7,8,9) THEN "Q3" double ELSE 'T4' LATE double

    However, it seems not be soon and there is no default value. I was just wondering what I'm doing wrong. Thank you!

    ~ Kevin Sun

    What is the problem with the answer you were given in this thread: OBIEE parameter default value a "quarter" guest dynamically?

  • How to set up the default value in the ADF option button?

    Hi all

    I use 11.1.6

    I want to put the default value in the radio button (in the UI).

    EX: I have a SelectOneRadio as sex

    In these two values, one is male and secondly a woman.

    I need to see the default value of the male part of the user interface.

    I mean when the loading of the page it should show male is checked in the user interface part?

    Someone help with this task?

    Ok

    So in your BinderSolutionsBean, you have an attribute called;

    String scenType;

    public String getScenType()...

    What you need to do is to initialize scenType to rtb;

    public BinderSolutionBean {}

    String scenType = "rtb";

    .

    .

    .

    }

    Hope this makes sense;

  • How to set the default value for the Group of radio buttons

    Hello
    Here's my situation.
    I have a form of HTML text. In the form, I have an element called "* drinks * ' and its options in the radio button group or coffee, tea. Now, I want to put a default value("NA") to the radio of drinks group. Is it feasible. If so, how. Advice would be useful. Thank you

    Hello!

    You can also set a default value in the radio unit of page article under the default setings. Here, you must put the result value (if you have static: Café;) One, the; B, NA; C you write C if you want NA default choice) of your radio.

    concerning

Maybe you are looking for

  • Vignette

    39 the version of firefox my page newtabs thumbnails went from 15 to 10 and I can not find a solution there back in return more zoom on the page. is it possible to fix this right now

  • Satellite Pro L40 - how to enable the WLan using ConfigFree

    Can you help me? My English is bad I do not end. The question is:My computer is a Toshiba Satellite Pro L40 and I use the ConfigFree for the wireless, but it seems that the WiFi network is disabled. Help please!I want to know what's wrong Thank you!!

  • Good job Motorola!

    Today I received my D3. During the last few hours setting up. I'm not even close to be completed. I can't believe the build quality on this phone. When you hold you know you have a high-end quality device in your hands. IM happy that my Droid X is de

  • Computer keeps restarting, blue screen after windows logo.

    Hello! My computer keeps restarting. It gets to the windows logo then a blue screen for 1/2 seconds and it restarts. The last good configuration does not change. Tho, safe mode works (im writing this safe mode with networking). Last night I scanned m

  • Exceeded series number order entry recovery disk

    Order the recovery for Pavilion dv7-1245dx disc. I am in the USA so checked that. Entered the serial number on the purchase order. Returned incorrect number. I tried new and same error. Tried the letter instead of zero/zero - same error. Then, as the