How to use init parameters?

Is it posible to use init parameters with FacesServlet?
With any other servlet I'd do this:
<servlet>
- <init-param>
  <param-name>base</param-name>
  <param-value>/shop</param-value>
  </init-param>
</servlet>but it doesn't seem correct to the same with the FacesServlet ie:
<servlet>
  <servlet-name>Faces Servlet</servlet-name>
  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
- <init-param>
  <param-name>imageURL</param-name>
  <param-value>/images/</param-value>
  </init-param>What is the right way to use init params with JSF?

You don't have control over the FacesServlet.
Rather use the context-param.
<context-param>
    <param-name>paramName</param-name>
    <param-value>paramValue</param-value>
</context-param>
String paramName = facesContext.getExternalContext().getInitParameter("paramName");

Similar Messages

  • How to edit Init Parameters using OEM Website?

    How can one edit an init parameter of a servlet runnig in Oracle 9 iAS.
    I have Oracle 9iAS r2 running on a Win2K with 512 MB RAM. Everything works fine excpet editing the init parameters using OEM Website. The documentation says its possible to edit the init parameters by clicking on it. But here, the init parameters are not having hyperlinks. Please help...

    Thanks for the instant reply.
    If that is the case, what is the way out then?
    How can the end-user (ofcourse, the 9iAS administrator at customer site) change the init parameters?
    What we have suggested is to edit the web.xml in the EAR before deploying the application. Is it the only way out? Customer find it difficult to accept.
    Please help.
    Thanks in advance,
    -Jamal

  • How to use Default parameters

    Hello,
    How do I use default parameters from ODP.NET. I have a proc in Oracle that shows Default? = Y when I do Describe in PL/SQL Developer. Therefore, I don't want to pass this parameter at all via ODP.NET/C# call. If I omit this parameter, I get the dreaded "Invalid number or types of parameters" error.
    Thanks for your help,
    Evgueni

    Hi,
    You'll just want to set OracleCommand::BindByName=true. Here's an example, hope it helps.
    Greg
    create or replace function showparams(p1 varchar2, p2 varchar2 default 'foo',
               p3 varchar2, p4 varchar2 default 'bar') return varchar2
    is
    retval varchar2(4000);
    begin
    retval := 'p1 = '|| p1;
    retval := retval || ',p2 = ' || p2;
    retval := retval || ',p3 = ' || p3;
    retval := retval || ',p4 = ' || p4;
    return retval;
    end;
    using System;
    using System.Data;
    using Oracle.DataAccess.Client;
    class testdefault
        static void Main(string[] args)
            using (OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger"))
                con.Open();
                using (OracleCommand cmd = new OracleCommand("showparams", con))
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.BindByName = true;
                    cmd.Parameters.Add( new OracleParameter("retval", OracleDbType.Varchar2,4000));
                    cmd.Parameters["retval"].Direction = ParameterDirection.ReturnValue;
                    cmd.Parameters.Add("p1", "firstval");
                    cmd.Parameters.Add("p3", "secondval");
                    cmd.ExecuteNonQuery();
                    Console.WriteLine(cmd.Parameters["retval"].Value.ToString());
    }OUTPUT
    =========
    p1 = firstval,p2 = foo,p3 = secondval,p4 = bar
    Press any key to continue . . .

  • How to use HTML parameters in Java applet

    Hello
    In perl I have created a form with things like a selectiuon box called currency and text fields called product for example. Then when I click submit the perl program can pick up the currency and product parameters.
    I have read about applet param eg <param name="param1" value="Apple"> is this the same thing? Or is it different?
    Can I use HTML parameters or do I need to use applet param? I am confused.
    If applet param is what I need, then how do I change the param values say by editing text in a text field?

    You will need to use Java Native Interface JNI. Ther are many posts on the subject, please search, and this is the documentation:
    http://java.sun.com/j2se/1.5.0/docs/guide/jni/spec/jniTOC.html

  • How to use event parameters?

    Hi
    I've made simple eem applet for shutdown the port which trigered storm control event.
    It is look like that:
    event manager applet shut-storm
      event storm-control
      action 1.0 cli local python bootflash:shut-storm.py
    and the script is
    from cisco import CLI
    from cisco import cli
    import sys
    import datetime
    import time
    import re
    whitelist = [
    "Ethernet1/1",
    "Ethernet1/2"]
    shlog = CLI('sh logg last 100 | i ETHPORT-5-STORM_CONTROL_ABOVE_THRESHOLD | last 3',False).get_output()
    pat = re.compile(r'(\d{4} \w{3} \d{2} \d\d:\d\d:\d\d) \S+ \%ETHPORT-5-STORM_CONTROL_ABOVE_THRESHOLD: Traffic in port (Eth\S+|[Pp]o\S+)')
    now = datetime.datetime.now()
    delta = datetime.timedelta(seconds=180)
    for l in shlog:
      mobj = pat.match(l)
      if mobj:
        port       = mobj.group(2)
        logTimeStr = mobj.group(1)
        logTimeObj = time.strptime(logTimeStr, "%Y %b %d %H:%M:%S")
        logTime    = datetime.datetime(*logTimeObj[:6])
        if now-logTime < delta:
          if port not in whitelist:
            cli("conf t")
            cli("interface %s" % port)
            cli("shutdown")
    But the python script is a bit complecs because it shoud find triggered interfece in log.
    Is it possible to use event parameters? And how?
    I know that they are:
    sw1# sh event manager history events det
    Event ID Time of Event        Event Type                   Slot       Policies
    32       09/30/2013 15:40:51  storm_control                active(1)  shut-storm
        interface = "Ethernet1/16", cause = "storm-control"

    Thank you Joseph.
    It works.
    Now the applet looks like:
    event manager applet shut-storm2
      event storm-control
      action 1.0 cli local python bootflash:shut-storm2.py $interface
    And the script:
    from cisco import cli
    from syslog import syslog
    import sys
    whitelist = [
    "Ethernet1/1",
    "Ethernet1/2"]
    port = sys.argv[1]
    if port not in whitelist:
      cli("conf t")
      cli("interface %s" % port)
      cli("shutdown")
      syslog(2, "Interface %s was shutdown due to storm conditions" % port)

  • How to use Import parameters of a search help

    Hi,
    Could you please tell me how to use import & export parameters of a search help in the report.

    Hi,
    Import parameters are imported from the selection screen of the report into the search help and then these are used to query in the search help.
    For example
    case 1.
    parameters : p_carrid like sflight-carrid.
    parameters : p_connid like sflight-connid.
    the search help that is used in the above condition is
    SFLIGHT.
    And the selection method is SFLIGHT in this search help.
    ( to check which search help is used go to se11 display the table and put your cursor on the field and in the menu for goto--> search help.)
    so when you do an F4 on connid it looks for a field which is declared like SFLIGHT-CARRID ( and the value entered in it) since the SFLIGHT-CARRRID is an import parameter in the search help,  and queries the database where the value is equal to the p_carrid which is declared like SFLIGHT-CARRID and gets only data which is equal to carrid
    case 2.
    parameters : p_carrid like SCARR-carrid.
    parameters : p_connid like sflight-connid.
    In this case the system will fetch all the data.
    since there is no parameter for SFLIGHT-CARRID on the selection screen it would get all the data from SFLIGHT.

  • How to use URL parameters in Flex?

    Hello Everyone,
    I wanted to know how can the parameters passed in a URL be used in our Flex application. I searched in the forum and tried these links:
    http://forums.adobe.com/message/217950#217950
    http://www.danvega.org/blog/index.cfm/2009/2/5/Flex-FlashVars-in-local-development
    In the second link, this is the solution provided:
       1. // if we've detected an acceptable version
       2. // embed the Flash Content SWF when all tests are passed
       3. AC_FL_RunContent(
       4.         "src", "ffManager",
       5.         "width", "100%",
       6.         "height", "100%",
       7.         "align", "middle",
       8.         "id", "ffManager",
       9.         "quality", "high",
      10.         "bgcolor", "#869ca7",
      11.         "name", "FFManager",
      12.         "allowScriptAccess","sameDomain",
      13.         "type", "application/x-shockwave-flash",
      14.         "pluginspage", "http://www.adobe.com/go/getflashplayer",
      15.         "flashvars","username=dvega"
      16. );
    private function init():void {
        // grab the username so we can track who is logged in
        [Bindable] private var:username= Application.application.parameters.username;
    But here, I am getting the hardcoded value (ie.,dvega) as the data inside my flex application. Instead I would need the dynamic data that is passed through the URL. For Ex: if I use the URL, http://172.22.41.154/MH_2.html?myName=Arush
    I need would need to use the name 'Arush' inside the application. Can you please help me on how and what part of the code is to be modified?
    Thank you,
    Warm regards,
    Deepak

    That would come within flex.
    In my case, there is a SAP CRM web application which has a push button. On click of this button, flex URL is called(ie., http://172.22.41.154/MH_Bluebook_Integration2.html). On click of that button I need to pass an Object ID, which is passed withing that flex URL, something like this:
    http://172.22.41.154/MH_Bluebook_Integration2.html?objID=abcd
    I need to receive 'abcd' in the flex. Any way we could modify the HTML wrapper to send this value to swf? 

  • How to use additional parameters in SM49

    Hi,
    I wrote a CMD file witch copies a file from one directory to another, the source and destention are both parameteres,
    how do I sent the 2 parameters using SM49?
    the command file looks like this:
    copy %1% %2%
    The system is windows
    Thanks,
    Naama.

    Right click on the References node in the project navigator and select: Add New Library Reference. In the subsequent dialog, specify the path to the jar file you wish to include. This library will be automatically added to the application classpath at design time and deployed with the application when you run the project.

  • How to use Style Parameters ?

    Hi,
    in JDEV I have created a VO with a query (pasted from sqlplus) that does a select cross a couple of tables. I need to parameterise the query but cant see how to do it. It looks like you could use
    ' where table.atttribute = :1' as part of the query in the View Object designer. Selecting the check box ? Style Parameters means the sql tests as valid. But when you apply the changes you get a value not bound error.
    How do you get the parameter from (for example) a form value, into the view ? Is there a way to do this and ignore the variable not bound error mentioned above ?
    Seems like it should be intuitive, but I've obviously missed that bit of the developers guide :-)
    Any pointers would be great.
    Paul

    There is no direct way to bind the Form Fields to the query.
    You need to do the following:
    Use the pageContext.getParameter("param_name") to get the value for the form field.
    Use the am.invokeMethod to bind the variable as below in your view method:
    setWhereClauseParams(null); // Always reset
    setWhereClause(null);
    setWhereClauseParam(0,qotHdrId);
    executeQuery();
    This should work. Hope this helps.

  • How to use DATETIME parameters in stored procedure?

    I can not define a variable or parameters
    with data type of DATETIME
    when I define stored procedure using Developer/2000.
    Does Oracle not support DATETIME?
    null

    Chen Honghua (guest) wrote:
    : I can not define a variable or parameters
    : with data type of DATETIME
    : when I define stored procedure using Developer/2000.
    : Does Oracle not support DATETIME?
    Oracle supports DATETIME data type.
    "DATETIME" data type is stored in "DATE" data type.
    if you want to DEFINE "10-Jan-1998 10:20" :
    declare
    dummy_date date:=to_date('10-jan-1998 10:00','DD-MON-YYYY
    HH24:MI');
    BEGIN
    END;
    null

  • How to use lexical parameters with Sql Server Stored Procedure?

    Hi,
    I'm developing a BI Publisher report on a sql server database. I need to execute a stored procedure to dynamically build the query by replacing the lexical parameters with the values of varaibles of the stored procedure. With Oracle stored procedures, I have used data template and had reference the varaiable in SP by prefixing it with '&'.
    It doesn't work if I try to do the same thing with SQL server. Is there anyone who has come across the similar situation? Please let me know if anyone has got any ideas...
    Thanks in Advance
    Rag

    TopLink currently doesn't support multiple ResultSets. Multiple ResultSets support is considered for a future release.

  • How to use reference parameters (BAPI Import Parameters) in SQL statements

    Dear SAP gurus
    I have a question on using parameters passed in a custom BAPI in SQL statements.
    I am sending 2 parameters  TABLENAME, COLUMNNAME into a custom bapi.
    In the BAPI I need to give an sql command some thing like
    select * from TABLENAME where COLUMNNAME = '100'.
    Where TABLENAME and COLUMNAME may vary depend on what parameters are sent while calling this BAPI.
    Even defining an internal table that has the structure of TABLENAME is not working.
    I used the following statement 'data: ls_TABLENAME type TABLENAME', which generates error message saying TABLENAME is unknons.
    Any feedback will be highly appreciated.
    Thanks
    Ram

    As far as I know you can not give parameter to a select query like that. You should describe the tablename and the columnname as string type.  Then assign the values to them you want to use in query.
    data: str_table type string.
    data: str_column type string.
    select * from  (str_table)  into  <g_t_table>  where (str_column)  = '100'.
    If the table name is not determined until runtime, you must specify an output area with INTO .

  • How to use different parameters for two tables(chart and Table) in one report in SSRS?

    Hi,
    Here is my requirement, i have 7 parameters in my report(Site,Account,LOB,year,Month,WeekDay and Date_Filter),
    and in my report i have one table and one Chart,
    my requirement is the table in the report has to show the data for 6 parameters only i.e(Site,Account,LOB,year,Month and WeekDay).so the table has to consider only 6 parameters, and it has ignore the 7th parameter, table should not consider Date_Filter parameter.
    And Chart has to consider all 7 parameters.
    so, when we preview the report table has to show the data for only 6 parameters and chart has to show the data for all 7 parameters.
    if there is a way to get this Please reply me ASAP, it is an urgent requirement.
    Thanks in Advance,
    Naveen

    Hi Naveen,
    Refer below link to create multiple datasets as suggested by Gnanadurai
    http://technet.microsoft.com/en-us/library/ff714047(v=sql.105).aspx
    Thanks
    Swapna

  • How to use global parameters in Opertional Mapping??

    Hi,
    I have to create 4 mappings.
    1. File to PI(Graphical): To extract Payload form incoming hedaer,payload & trailer & few validation which gives an ERROR variable.
    2. XSLT: payload to IDOC stucture data type.
    3. To IDoc(Graphical): final mapping to IDoc.
    4. Mail mapping: here i need the ERROR variable to flow through all mappings so that I can make an RFC call in this mapping using ERROR variable.
    Please provide inputs.

    Hi Das,
    take XSD of IDoc and add one field (Error flag) and use this structure in first level mapping between File to IDoc1,then IDoc 1 to Original IDoc.
    or
    You can use unsed field in IDoc it self to hold error variable details(may be in control record or some where in IDoc) ,befor esedning data to ECC, suppress this value.
    Regards,
    Raj

  • How to use page parameters with inline rendering portlet

    I am trying to use the inline rendering portlet. Basic functionality works fine.
    What I am trying to do is make the inline rendering portlet use a page parameter. Is this possible?
    I have read pdk articles, but nothing seems to have what I need.
    Any ideas are appreciated.

    Perhaps i might have missed something, but what do you mean by the inline rendering portlet? Are you referring to the URL services portlets that rendered content inline (in the same Portal context & window without popping a new window)?
    I would be able to look into this if you could elaborate on the issue at hand.
    Regards,
    Abhinav

Maybe you are looking for

  • Adding Movies/TV Shows to 12.1 no longer works

    After updating to 12.1.0.71 on windows, seeing the following issues 1. Can no longer add videos (Movies and TV Shows) to itunes 2. Attempt to play a movie or tv show on itunes the following message is received:  "This Movie requires quick time which

  • Release of Blocked Invoices - MR02

    Dear Gurus, I have four A/P documents that were blocked for payment, "R", however before I could remove the block, the A/P persons discovered they made an error and canceled/cleared the documents.  So, now they are no longer in "open items" but the b

  • Airport Express Not Capturing Correct IP Address

    I've had my iMac G5 for about 18 months. I access the Internet via a cable modem. Last night I lost the ability to access the Internet. A Comcast technician walked me thru various steps and determined that my modem and computer were working fine, and

  • Extracting individual drivers from BC 2.1  update ?

    I am trying to sync a Windows PDA (Vista OS w/Parallels),,and don't want to do a total update for fear of getting problems that many of you are having trouble with.So, I am wondering whether I for example,get the bluetooth drivers (or any other separ

  • Forms9i demos problem

    After downloading and installing Forms9i demos with success I can't run the demos. When I try to run the startup html-file it can't find the page: http://mysrv:8888/forms90demo/demo90.html The OC4J is running... Ideas?? Thanks Daniel